Re: Question about ForeignKeys and subclasses

2009-06-03 Thread Ian Lewis
Rex, My appologies. Though the feature is in 1.0 I gave a link to the 1.1 documentation. Django 1.0 docs: http://docs.djangoproject.com/en/1.0/topics/db/models/#id7 2009/6/3 Ian Lewis > Rex, > > Django parent model instances will also have a property equal to the >

Re: Question about ForeignKeys and subclasses

2009-06-03 Thread Ian Lewis
Rex, Django parent model instances will also have a property equal to the lowercase name of the subclass. So for Animal instances that happen to be a Duck you can do something like "my_room.animal.duck" to get the Duck instance. Depending on what you are doing you might want to try that. It's

Re: Question about ForeignKeys and subclasses

2009-06-01 Thread Daniel Roseman
On Jun 1, 5:39 am, Rex wrote: > Hello, > > I have a question that is best illustrated by the following fictional > example. (I put my question at the end.) > > #= > # In models.py > class Room(models.Model): >     animal = models.ForeignKey(Animal) > > class

Question about ForeignKeys and subclasses

2009-05-31 Thread Rex
Hello, I have a question that is best illustrated by the following fictional example. (I put my question at the end.) #= # In models.py class Room(models.Model): animal = models.ForeignKey(Animal) class Animal(models.Model): #[...] class Duck(Animal): #[...] # In views.py