- Income model: date, concept, amount per user - LiveView handlers: add, edit, save, cancel edit, delete - Inline add form at bottom of table - Inline edit: row expands to editable inputs with Save/Cancel - Table re-renders after each operation via LiveView partial
44 lines
924 B
Python
44 lines
924 B
Python
# Generated by Django 6.0 on 2026-03-17 14:14
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("monthly", "0001_initial"),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Income",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("date", models.DateField()),
|
|
("concept", models.CharField(max_length=255)),
|
|
("amount", models.DecimalField(decimal_places=2, max_digits=10)),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="incomes",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["date"],
|
|
},
|
|
),
|
|
]
|