Tricky model inheritance - Django

Posted by RadiantHex on Stack Overflow See other posts from Stack Overflow or by RadiantHex
Published on 2010-03-22T02:01:42Z Indexed on 2010/03/22 2:11 UTC
Read the original article Hit count: 552

Hi folks,

I think this is a bit tricky, at least for me. :)

So I have 4 models Person, Singer, Bassist and Ninja.

Singer, Bassist and Ninja inherit from Person.


The problem is that each Person can be any of its subclasses.

e.g. A person can be a Singer and a Ninja. Another Person can be a Bassist and a Ninja. Another one can be all three.

How should I organise my models?


Help would be much appreciated!

© Stack Overflow or respective owner

Related posts about django

Related posts about django-models