From e054597d93956eee55dabda8d36ab124e756b164 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 13 Nov 2022 09:50:37 -0600 Subject: bdgt: added fixed monthly income tracker --- app/budget/admin.py | 8 ++++++-- app/budget/migrations/0010_luxfixedmonthly_amount.py | 18 ++++++++++++++++++ app/budget/models.py | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 app/budget/migrations/0010_luxfixedmonthly_amount.py (limited to 'app/budget') 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) -- cgit v1.2.3-70-g09d2