mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-23 17:18:44 +02:00
refactor: move some fields and widgets around
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Generated by Django 5.1.1 on 2024-09-19 02:11
|
||||
|
||||
import apps.transactions.fields
|
||||
import apps.common.fields.month_year
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
@@ -8,19 +8,31 @@ class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Transaction',
|
||||
name="Transaction",
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_paid', models.BooleanField(default=True)),
|
||||
('date', models.DateField()),
|
||||
('reference_date', apps.transactions.fields.MonthYearField(help_text='Please enter a month and year in the format MM/YYYY.')),
|
||||
('description', models.CharField(max_length=500)),
|
||||
('notes', models.TextField(blank=True)),
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("is_paid", models.BooleanField(default=True)),
|
||||
("date", models.DateField()),
|
||||
(
|
||||
"reference_date",
|
||||
apps.common.fields.month_year.MonthYearModelField(
|
||||
help_text="Please enter a month and year in the format MM/YYYY."
|
||||
),
|
||||
),
|
||||
("description", models.CharField(max_length=500)),
|
||||
("notes", models.TextField(blank=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Generated by Django 5.1.1 on 2024-09-19 13:35
|
||||
|
||||
import apps.transactions.fields
|
||||
import apps.common.fields.month_year
|
||||
import apps.transactions.validators
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
@@ -9,46 +9,62 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0001_initial'),
|
||||
('transactions', '0001_initial'),
|
||||
("accounts", "0001_initial"),
|
||||
("transactions", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='transaction',
|
||||
name='account',
|
||||
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.PROTECT, to='accounts.account', verbose_name='Account'),
|
||||
model_name="transaction",
|
||||
name="account",
|
||||
field=models.ForeignKey(
|
||||
default=0,
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="accounts.account",
|
||||
verbose_name="Account",
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='transaction',
|
||||
name='amount',
|
||||
field=models.DecimalField(decimal_places=18, default=0, max_digits=30, validators=[apps.transactions.validators.validate_non_negative, apps.transactions.validators.validate_decimal_places], verbose_name='Amount'),
|
||||
model_name="transaction",
|
||||
name="amount",
|
||||
field=models.DecimalField(
|
||||
decimal_places=18,
|
||||
default=0,
|
||||
max_digits=30,
|
||||
validators=[
|
||||
apps.transactions.validators.validate_non_negative,
|
||||
apps.transactions.validators.validate_decimal_places,
|
||||
],
|
||||
verbose_name="Amount",
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='date',
|
||||
field=models.DateField(verbose_name='Date'),
|
||||
model_name="transaction",
|
||||
name="date",
|
||||
field=models.DateField(verbose_name="Date"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='description',
|
||||
field=models.CharField(max_length=500, verbose_name='Description'),
|
||||
model_name="transaction",
|
||||
name="description",
|
||||
field=models.CharField(max_length=500, verbose_name="Description"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='is_paid',
|
||||
field=models.BooleanField(default=True, verbose_name='Paid'),
|
||||
model_name="transaction",
|
||||
name="is_paid",
|
||||
field=models.BooleanField(default=True, verbose_name="Paid"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='notes',
|
||||
field=models.TextField(blank=True, verbose_name='Notes'),
|
||||
model_name="transaction",
|
||||
name="notes",
|
||||
field=models.TextField(blank=True, verbose_name="Notes"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='transaction',
|
||||
name='reference_date',
|
||||
field=apps.transactions.fields.MonthYearField(verbose_name='Reference Date'),
|
||||
model_name="transaction",
|
||||
name="reference_date",
|
||||
field=apps.common.fields.month_year.MonthYearModelField(
|
||||
verbose_name="Reference Date"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user