summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2022-11-12 12:17:10 -0600
committerluxagraf <sng@luxagraf.net>2022-11-12 12:17:10 -0600
commit230febc2c3fd689bf3aa5fd0f33a1a3e69742eb8 (patch)
tree5217faea97a4f547e4a8364777b66ba6549f44ea
parent4d892ad57c7d01a121500413813cd80d89309c42 (diff)
bdgt: renamed cat to category to finish migration
-rw-r--r--app/budget/models.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/app/budget/models.py b/app/budget/models.py
index 6d1d113..b5b00a4 100644
--- a/app/budget/models.py
+++ b/app/budget/models.py
@@ -48,24 +48,13 @@ class LuxPurchaseStatsManager(models.Manager):
start_date = datetime.date(timezone.now().year, start_month, 1)
last_day = calendar.monthrange(timezone.now().year, month)[1]
end_date = datetime.date(timezone.now().year, month, last_day)
- return self.filter(date_recorded__range=(start_date, end_date)).filter(cat=cat).aggregate(Sum('amount'))
+ return self.filter(date_recorded__range=(start_date, end_date)).filter(category=cat).aggregate(Sum('amount'))
class LuxPurchase(models.Model):
amount = models.DecimalField(max_digits=6, decimal_places=2)
source = models.ForeignKey(LuxSource, on_delete=models.CASCADE)
- CATEGORY = (
- (0, 'Grocery & Home'),
- (1, 'Gas'),
- (2, 'Bus'),
- (3, 'Lodging'),
- (4, 'Books'),
- (5, 'Clothes'),
- (6, 'Eating Out'),
- (7, 'Misc'),
- )
- category = models.IntegerField(choices=CATEGORY, default=0)
- cat = models.ForeignKey(LuxSpendingCategory, null=True, on_delete=models.CASCADE)
+ category = models.ForeignKey(LuxSpendingCategory, null=True, on_delete=models.CASCADE)
date_recorded = models.DateTimeField(auto_now_add=True)
class Meta: