ContentType for proxy models

2010-05-26 Thread TallFurryMan
Hello, I wrote a model which is not abstract, and from which a few specialized classes derive: | class Action( Model ): | item = ForeignKey( Item ) | # A few other properties | | class Move( Action ): | class Meta: | proxy = True | | class Pick( Action ) | class Meta: |

Re: OneToOneField usage

2010-05-13 Thread TallFurryMan
Thanks for this insight. I was using OneToOneField in the same way as ForeignKey. | class Person( Model ): | pass | | class Pet( Model ): | owner = ForeignKey( Person ) | | # Assuming "joe" exists as a Person | >>> kitty = joe.pet_set.get_or_create() Yes, in that situation "joe.pet_set"

OneToOneField usage

2010-05-13 Thread TallFurryMan
Hello Django users, Is there a particular reason why using a related OneToOneField raises DoesNotExist instead of returning None? | class Person( Model ): |pass | | class Pet( Model ): |owner = OneToOneField( Person ) | | # Assuming "joe" exists as a Person | >>> kitty = joe.pet |