I have this 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
BillData
and BillFooter
are common to every BillHeader
so I've marked them as abstract
. Can I do class BillHeader(BillData, BillFooter)
or I'm doing something wrong?
I also thought about doing BillData
the main one, and BillHeader
BillFooter
abstract. I don't have any experience on doing data models (at least not complex ones) and I'm a bit lost. What would you recommend?