diff --git a/api/migrations/0004_alter_transaction_category.py b/api/migrations/0004_alter_transaction_category.py new file mode 100644 index 0000000..a8cc100 --- /dev/null +++ b/api/migrations/0004_alter_transaction_category.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0 on 2021-12-25 12:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0003_remove_transaction_username_transaction_user'), + ] + + operations = [ + migrations.AlterField( + model_name='transaction', + name='category', + field=models.CharField(choices=[('Rent', 'Rent'), ('Travel', 'Travel'), ('Investment', 'Investment'), ('Shopping', 'Shopping'), ('Learning', 'Learning'), ('Fees', 'Fees'), ('Other', 'Other')], default='oth', max_length=10), + ), + ] diff --git a/api/models.py b/api/models.py index afb51c9..f07d04d 100644 --- a/api/models.py +++ b/api/models.py @@ -8,15 +8,15 @@ class Transaction(models.Model): name = models.CharField(max_length=500) amount = models.IntegerField() categories = [ - ('ren', 'Rent'), - ('tra', 'Travel'), - ('inv', 'Investment'), - ('sho', 'Shopping'), - ('lea', 'Learning'), - ('fee', 'Fees'), - ('oth', 'Other'), + ('Rent', 'Rent'), + ('Travel', 'Travel'), + ('Investment', 'Investment'), + ('Shopping', 'Shopping'), + ('Learning', 'Learning'), + ('Fees', 'Fees'), + ('Other', 'Other'), ] - category = models.CharField(max_length=3, default='oth', choices=categories) + category = models.CharField(max_length=10, default='oth', choices=categories) note = models.TextField() def __str__(self): diff --git a/db.sqlite3 b/db.sqlite3 index e4ccd22..192e7cf 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/frontend/templates/home.html b/frontend/templates/home.html index 3b78a15..ef44288 100644 --- a/frontend/templates/home.html +++ b/frontend/templates/home.html @@ -15,6 +15,115 @@ + +
@@ -26,34 +135,38 @@