https://git.jolheiser.com/mint.git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
from django.db import models class Transaction(models.Model): title = models.CharField(max_length=100) cents = models.BigIntegerField() date = models.DateField() recurrance = models.CharField(max_length=10) is_income = models.BooleanField(default=False) @property def amount(self) -> float: return self.cents / 100 @property def display(self) -> str: return f"{self.title} (${self.amount:,.2f})" def __str__(self): return self.display