Skip to content

Commit

Permalink
Create, update, delte functions as fetch api js added in home.html fu…
Browse files Browse the repository at this point in the history
…ll crud operations done
  • Loading branch information
supsa-ak committed Dec 20, 2021
1 parent 3e79c87 commit 7296280
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 118 deletions.
18 changes: 18 additions & 0 deletions api/migrations/0004_alter_transaction_category.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
16 changes: 8 additions & 8 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
Loading

0 comments on commit 7296280

Please sign in to comment.