Created
February 21, 2018 16:54
-
-
Save Jbwzx/9b6548ab30e27173502cfc80ab6348a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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