Multi-level inheritance for the model and migrations?

16 views
Skip to first unread message

b...@tanners.org

unread,
Mar 5, 2019, 1:23:54 AM3/5/19
to Django users
Can you have multiple levels if inheritance in your models?

Not "multiple inheritance" multiple level inheritance. 

Something like


class ArchBase(models.Model):
obj = models.CharField(max_length=128, blank=False, null=False)

class Meta:
abstract = True

class Armour(ArchBase):
name_pl = models.CharField(max_length=128, blank=False, null=False)

class Meta:
abstract = True

class Boots(Armour):
body_foot = models.IntegerField(blank=False, null=False, default=-1)

The error I get when I try to create some Boots

Exception Type:OperationalError
Exception Value:
no such table: items_boots


And I do not see the items_boots table in my SQL Lite database.
Reply all
Reply to author
Forward
0 new messages