Best way to set up Django model for a balance sheet app

I want to create simple app where a user can keep track of their net worth over time. For example, the user could go in at the end of each month and input their balances for all of their assets and liabilities. The app would keep track of the data over time so it could be displayed as a graph.

I'm trying to figure out how to set up my models for this. I think I need to have the balances as a separate class otherwise every time you wanted to add a new date you would have to update the model itself. Here's what I came up with. I'm interested if this is a good way to do this or if there is a cleaner way.

class Asset(models.Model):
    name = models.CharField(max_length=30)
    description = models.TextField()

class Liability(models.Model):
    name = models.CharField(max_length=30)
    description = models.TextField()
    linked_account = models.ForeignKey(Asset,null=True,blank=True)
    
    class Meta:
        verbose_name_plural = "Liabilities"

class AssetBalance(models.Model):
    account = models.ForeignKey(Asset)
    date = models.DateField()
    balance = models.FloatField()
    
class LiabilityBalance(models.Model):
    account = models.ForeignKey(Liability)
    date = models.DateField()
    balance = models.FloatField()
Back to Top