Here are my schematic models:
class Law(models.Model):
...
class Bill(models.Model):
...
class PrivateBill(Bill):
...
class GovernmentBill(Bill):
...
It is possible and possible that in the future I (or maybe someone else) will want to add more types of Bill.
Each bill should point to the Law (indicating which law this bill will change), and my question is: What is the best way to implement this?
If I add ForeignKey (Law) to Bill , I will have a relationship from each bill to the law, but the law will only have an inverse relationship . Accounts (bill_set), and not another inverse relationship to each type of account. Of course, I can filter out each type of account to get only those that indicate a specific Law, but this is what I think I will need to use often, so I think privatebill_set, governmentbill_set, etc. more readable.
Another possible solution is to add a foreign key to each of the inherited classes (this will give me privatebill_set, governmentbill_set, futurebill_set), but this seems hairy because I will rely on future programmers to remember to add this relationship.
?