I have a model Person
which stores all data about people. I also have a Client
model which extends Person. I have another extending model OtherPe
What you are doing is not possible as you do it, Django has specific rules for inheritance
The only possible schema is:
class Parent(models.Model):
class Meta:
abstract = True # MUST BE !!! This results in no relation generated in your DB
field0 = models.CharField(...
...
# here you're allowed to put some functions and some fields here
class Child(models.Model):
field1 = models.CharField(...
...
# Anything you want, this model will create a relation in your database with field0, field1, ...
class GrandChild(models.Model):
class Meta:
proxy = True # MUST BE !!! This results in no relation generated in your DB
# here you're not allowed to put DB fields, but you can override __init__ to change attributes of the fields: choices, default,... You also can add model methods.
This is because there is no DB inheritance in most DBGS. Thus you need to make you parent class abstract
!