Add real date field to transactions
This commit is contained in:
parent
83aefe1f84
commit
215787e204
2 changed files with 20 additions and 1 deletions
18
nummi/main/migrations/0003_transaction_real_date.py
Normal file
18
nummi/main/migrations/0003_transaction_real_date.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.0.4 on 2022-05-22 11:35
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('main', '0002_alter_snapshot_date_alter_snapshot_diff'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='transaction',
|
||||
name='real_date',
|
||||
field=models.DateField(blank=True, null=True),
|
||||
),
|
||||
]
|
|
@ -31,6 +31,7 @@ class Transaction(models.Model):
|
|||
description = models.TextField(null=True, blank=True)
|
||||
value = models.DecimalField(max_digits=12, decimal_places=2, default=0)
|
||||
date = models.DateField(default=date.today)
|
||||
real_date = models.DateField(blank=True, null=True)
|
||||
trader = models.CharField(max_length=128, blank=True, null=True)
|
||||
category = models.ForeignKey(
|
||||
Category, on_delete=models.SET_NULL, blank=True, null=True
|
||||
|
@ -49,7 +50,7 @@ class Transaction(models.Model):
|
|||
class TransactionForm(ModelForm):
|
||||
class Meta:
|
||||
model = Transaction
|
||||
fields = ["date", "name", "value", "trader", "category", "description"]
|
||||
fields = ["date", "name", "value", "trader", "category", "real_date", "description"]
|
||||
|
||||
|
||||
class Invoice(models.Model):
|
||||
|
|
Loading…
Reference in a new issue