Skip to content

Instantly share code, notes, and snippets.

@Jbwzx
Created February 21, 2018 16:54
Show Gist options
  • Save Jbwzx/9b6548ab30e27173502cfc80ab6348a6 to your computer and use it in GitHub Desktop.
Save Jbwzx/9b6548ab30e27173502cfc80ab6348a6 to your computer and use it in GitHub Desktop.
class SpendingCategory(models.Model):
category = models.CharField(max_length=32, null=False)
def __str__(self):
return self.category
class Meta:
verbose_name_plural = "Spending Categories"
class Spending(models.Model):
name = models.CharField(max_length=128)
date = models.DateField(default=datetime.date.today)
amount = models.FloatField()
month = models.ForeignKey(Month, on_delete=models.CASCADE)
category = models.ForeignKey(SpendingCategory, on_delete=models.CASCADE)
paid = models.BooleanField(default=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment