summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2022-11-13 09:50:37 -0600
committerluxagraf <sng@luxagraf.net>2022-11-13 09:50:37 -0600
commite054597d93956eee55dabda8d36ab124e756b164 (patch)
tree3893164c1336f74faa4d0f9685f3e8cda037c8f3 /app
parentff1ab737963fa564c46b64a747c96043bcc1970c (diff)
bdgt: added fixed monthly income tracker
Diffstat (limited to 'app')
-rw-r--r--app/budget/admin.py8
-rw-r--r--app/budget/migrations/0010_luxfixedmonthly_amount.py18
-rw-r--r--app/budget/models.py1
3 files changed, 25 insertions, 2 deletions
diff --git a/app/budget/admin.py b/app/budget/admin.py
index 3b2c0ac..3ab7d28 100644
--- a/app/budget/admin.py
+++ b/app/budget/admin.py
@@ -1,6 +1,5 @@
from django.contrib import admin
-
-from .models import LuxSource, LuxPurchase, LuxSpendingCategory
+from .models import LuxSource, LuxPurchase, LuxSpendingCategory, LuxFixedMonthly
@admin.register(LuxSpendingCategory)
@@ -21,3 +20,8 @@ class PurchaseAdmin(admin.ModelAdmin):
class Media:
js = ('next-prev-links.js',)
+
+
+@admin.register(LuxFixedMonthly)
+class LuxFixedMonthlyAdmin(admin.ModelAdmin):
+ list_display = ('name', 'amount')
diff --git a/app/budget/migrations/0010_luxfixedmonthly_amount.py b/app/budget/migrations/0010_luxfixedmonthly_amount.py
new file mode 100644
index 0000000..15461d4
--- /dev/null
+++ b/app/budget/migrations/0010_luxfixedmonthly_amount.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.0.6 on 2022-11-13 10:48
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('budget', '0009_rename_cat_luxpurchase_category'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='luxfixedmonthly',
+ name='amount',
+ field=models.DecimalField(decimal_places=2, max_digits=6, null=True),
+ ),
+ ]
diff --git a/app/budget/models.py b/app/budget/models.py
index b5b00a4..439570f 100644
--- a/app/budget/models.py
+++ b/app/budget/models.py
@@ -24,6 +24,7 @@ class LuxSpendingCategory(models.Model):
class LuxFixedMonthly(models.Model):
name = models.CharField(max_length=200)
+ amount = models.DecimalField(null=True, max_digits=6, decimal_places=2)
source = models.ForeignKey(LuxSource, on_delete=models.CASCADE)
category = models.ForeignKey(LuxSpendingCategory, on_delete=models.CASCADE)
date_recorded = models.DateTimeField(auto_now_add=True)