I'm trying to find the right way to make an instance of a subclass of
a model also an instance of a different subclass in the model, like
so:

class Person(models.Model):
   ...


class Customer(Person):
   ...


class Employee(Person):
  ...



If I have an instance of Employee that I want to have as a customer as
well, I can simply add the pk from person for employee into the
customer table. With this value in the database, Django treats the
person as a Customer when used as a customer, and as an employee when
used as an employee.

What is the correct way to do this? Is it possible without introducing
custom sql?

I'm thinking that I should be able to do something like:

c = Customer.objects.create(pk=Employee.pk)

but I can't seem to get it to work for me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to