Extended Django base-class with multiple instances

Posted by Gijs on Stack Overflow See other posts from Stack Overflow or by Gijs
Published on 2010-04-16T07:32:39Z Indexed on 2010/04/16 7:33 UTC
Read the original article Hit count: 543

I'm modeling a simple movie database using Django.

models.py defines a base model Person. I extend Person into Actor and Director, which works as I imagined. Persons must be unique.

When (in the Admin) I create an instance of Actor, and this person is also a Director, it won't save because of the unique = True. Any ideas how to solve this problem? (generic foreign keys?)

Thx

© Stack Overflow or respective owner

Related posts about django

Related posts about django-admin