Can a django model have two abstract classes?

I have these models:

class BillHeader(models.Model):
    billno = models.IntegerField(primary_key=True, blank=True)

class BillData(models.Model):
    price = models.DecimalField(_('Price'), max_digits=12, decimal_places=2)
    amount = models.DecimalField(_('Amount'), max_digits=6, decimal_places=2)

    [... rest of the model ...]

    class Meta:
        abstract = True

class BillFooter(models.Model):
    total = models.DecimalField(_('Total'), max_digits=12, decimal_places=2)

    [... rest of the model ...]

    class Meta:
        abstract = True

BillDataand BillFooterare common to all BillHeader, so I marked them as abstract. Can I do class BillHeader(BillData, BillFooter)or am I doing something wrong?

I also thought about making BillDatabasic, and BillHeader BillFooterabstract. I have no experience with data models (at least not complicated), and I got a little lost. What would you recommend?

+3
source share
1 answer

, Django , , " ". ... , , ​​. - .

, models.Model, , models.Model Bill. models.Model , .

, , Bill, BillHeader, BillData BillFooter. , Django (, Bill, Article, BlogPost, Photo ..).

, , , . , . , , Bill, UnpaidBill PaidBill... , , , ABC.

, , ABC .

+8

Source: https://habr.com/ru/post/1752331/