From b66d000ee469539ce7aea557b612c0444177e36d Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 15 Aug 2020 11:58:34 -0400 Subject: archived old unused apps and migrated fieldnotes to posts --- app/expenses/models.py | 62 -------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 app/expenses/models.py (limited to 'app/expenses/models.py') diff --git a/app/expenses/models.py b/app/expenses/models.py deleted file mode 100644 index fbcdd7a..0000000 --- a/app/expenses/models.py +++ /dev/null @@ -1,62 +0,0 @@ -from django.db import models -from django.urls import reverse -from django.utils import timezone - -CATS = ( - ('1', "Groceries"), - ('2', "Restaurants"), - ('3', "Camping"), - ('4', "Petrol"), - ('5', "Bus"), - ('6', "Misc"), -) - - -class Trip(models.Model): - name = models.CharField(max_length=200) - slug = models.SlugField() - start = models.DateTimeField(default=timezone.now, blank=True, null=True) - end = models.DateTimeField(default=timezone.now, blank=True, null=True) - dek = models.TextField(null=True, blank=True) - - def __str__(self): - return self.name - - def get_absolute_url(self): - return reverse("expenses:list_expense", kwargs={"slug": self.slug}) - -class Month(models.Model): - name = models.CharField(max_length=200) - year = models.IntegerField() - date = models.DateTimeField(default=timezone.now) - notes = models.TextField(null=True, blank=True) - - def __str__(self): - return "%s %s" %(self.name, self.year) - -class LuxExpense(models.Model): - category = models.CharField(max_length=2, choices=CATS, default=1) - amount = models.DecimalField(max_digits=8, decimal_places=2) - month = models.ForeignKey(Month, on_delete=models.CASCADE, null=True) - - def __str__(self): - return '%s-%s' %(self.month, self.get_category_display()) - - - -class Expense(models.Model): - name = models.CharField(max_length=200) - amount = models.DecimalField(max_digits=8, decimal_places=2) - date = models.DateTimeField(default=timezone.now) - notes = models.TextField(null=True, blank=True) - category = models.CharField(max_length=2, choices=CATS, default=1) - trip = models.ForeignKey(Trip, on_delete=models.CASCADE, null=True) - - class Meta: - ordering = ('-date',) - - def __str__(self): - return self.name - - def date_month(self): - return self.date.strftime("%b %Y") -- cgit v1.2.3-70-g09d2