diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/budget/admin.py | 8 | ||||
-rw-r--r-- | app/budget/migrations/0010_luxfixedmonthly_amount.py | 18 | ||||
-rw-r--r-- | app/budget/models.py | 1 |
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) |