Manually squashed migration
This commit is contained in:
parent
2972b3f741
commit
ff142520f4
1 changed files with 253 additions and 662 deletions
|
@ -1,7 +1,6 @@
|
||||||
# Generated by Django 4.1.4 on 2023-04-20 15:32
|
# Generated by Django 4.1.4 on 2023-04-20 15:32
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import django.contrib.postgres.operations
|
import django.contrib.postgres.operations
|
||||||
|
@ -20,6 +19,8 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
django.contrib.postgres.operations.TrigramExtension(),
|
||||||
|
django.contrib.postgres.operations.UnaccentExtension(),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name="Category",
|
name="Category",
|
||||||
fields=[
|
fields=[
|
||||||
|
@ -35,268 +36,32 @@ class Migration(migrations.Migration):
|
||||||
(
|
(
|
||||||
"name",
|
"name",
|
||||||
models.CharField(
|
models.CharField(
|
||||||
default="Catégorie", max_length=64, verbose_name="Nom"
|
default="Category", max_length=64, verbose_name="Name"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
("budget", models.BooleanField(default=True, verbose_name="Budget")),
|
||||||
|
(
|
||||||
|
"user",
|
||||||
|
models.ForeignKey(
|
||||||
|
editable=False,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to=settings.AUTH_USER_MODEL,
|
||||||
|
verbose_name="User",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"icon",
|
"icon",
|
||||||
models.CharField(
|
models.SlugField(
|
||||||
default="folder", max_length=64, verbose_name="Icône"
|
default="folder", max_length=24, verbose_name="Icon"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
("budget", models.BooleanField(default=True, verbose_name="Budget")),
|
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
"ordering": ["name"],
|
"ordering": ["name"],
|
||||||
"verbose_name": "Catégorie",
|
"verbose_name": "Category",
|
||||||
"verbose_name_plural": "Catégories",
|
"verbose_name_plural": "Categories",
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
|
||||||
name="Transaction",
|
|
||||||
fields=[
|
|
||||||
(
|
|
||||||
"id",
|
|
||||||
models.UUIDField(
|
|
||||||
default=uuid.uuid4,
|
|
||||||
editable=False,
|
|
||||||
primary_key=True,
|
|
||||||
serialize=False,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"name",
|
|
||||||
models.CharField(
|
|
||||||
default="Transaction", max_length=256, verbose_name="Nom"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"description",
|
|
||||||
models.TextField(blank=True, null=True, verbose_name="Description"),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"value",
|
|
||||||
models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Valeur",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"date",
|
|
||||||
models.DateField(default=datetime.date.today, verbose_name="Date"),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"trader",
|
|
||||||
models.CharField(
|
|
||||||
blank=True, max_length=128, null=True, verbose_name="Commerçant"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"category",
|
|
||||||
models.ForeignKey(
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
on_delete=django.db.models.deletion.SET_NULL,
|
|
||||||
to="main.category",
|
|
||||||
verbose_name="Catégorie",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"real_date",
|
|
||||||
models.DateField(blank=True, null=True, verbose_name="Date réelle"),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"payment",
|
|
||||||
models.CharField(
|
|
||||||
blank=True, max_length=128, null=True, verbose_name="Paiement"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
"ordering": ["-date"],
|
|
||||||
"verbose_name": "Transaction",
|
|
||||||
"verbose_name_plural": "Transactions",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name="Invoice",
|
|
||||||
fields=[
|
|
||||||
(
|
|
||||||
"id",
|
|
||||||
models.UUIDField(
|
|
||||||
default=uuid.uuid4,
|
|
||||||
editable=False,
|
|
||||||
primary_key=True,
|
|
||||||
serialize=False,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"name",
|
|
||||||
models.CharField(
|
|
||||||
default="Facture", max_length=256, verbose_name="Nom"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"file",
|
|
||||||
models.FileField(
|
|
||||||
max_length=128,
|
|
||||||
upload_to="invoices/",
|
|
||||||
validators=[
|
|
||||||
django.core.validators.FileExtensionValidator(["pdf"])
|
|
||||||
],
|
|
||||||
verbose_name="Fichier",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"transaction",
|
|
||||||
models.ForeignKey(
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="main.transaction",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
"verbose_name": "Facture",
|
|
||||||
"verbose_name_plural": "Factures",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name="Snapshot",
|
|
||||||
fields=[
|
|
||||||
(
|
|
||||||
"id",
|
|
||||||
models.UUIDField(
|
|
||||||
default=uuid.uuid4,
|
|
||||||
editable=False,
|
|
||||||
primary_key=True,
|
|
||||||
serialize=False,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"date",
|
|
||||||
models.DateField(
|
|
||||||
default=datetime.date.today, unique=True, verbose_name="Date"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"value",
|
|
||||||
models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Valeur",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"diff",
|
|
||||||
models.DecimalField(
|
|
||||||
blank=True,
|
|
||||||
decimal_places=2,
|
|
||||||
editable=False,
|
|
||||||
max_digits=12,
|
|
||||||
null=True,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"previous",
|
|
||||||
models.OneToOneField(
|
|
||||||
blank=True,
|
|
||||||
editable=False,
|
|
||||||
null=True,
|
|
||||||
on_delete=django.db.models.deletion.SET_NULL,
|
|
||||||
to="main.snapshot",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"file",
|
|
||||||
models.FileField(
|
|
||||||
blank=True,
|
|
||||||
max_length=128,
|
|
||||||
null=True,
|
|
||||||
upload_to="snapshots/",
|
|
||||||
validators=[
|
|
||||||
django.core.validators.FileExtensionValidator(["pdf"])
|
|
||||||
],
|
|
||||||
verbose_name="Fichier",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
"ordering": ["-date"],
|
|
||||||
"verbose_name": "Relevé",
|
|
||||||
"verbose_name_plural": "Relevés",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
django.contrib.postgres.operations.TrigramExtension(),
|
|
||||||
django.contrib.postgres.operations.UnaccentExtension(),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="invoice",
|
|
||||||
name="file",
|
|
||||||
field=models.FileField(
|
|
||||||
max_length=128,
|
|
||||||
upload_to=main.utils.get_path,
|
|
||||||
validators=[django.core.validators.FileExtensionValidator(["pdf"])],
|
|
||||||
verbose_name="Fichier",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="invoice",
|
|
||||||
name="transaction",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="main.transaction",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="file",
|
|
||||||
field=models.FileField(
|
|
||||||
blank=True,
|
|
||||||
default="",
|
|
||||||
max_length=256,
|
|
||||||
upload_to=main.utils.get_path,
|
|
||||||
validators=[django.core.validators.FileExtensionValidator(["pdf"])],
|
|
||||||
verbose_name="Fichier",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="category",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to=settings.AUTH_USER_MODEL,
|
|
||||||
verbose_name="Utilisateur",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="invoice",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to=settings.AUTH_USER_MODEL,
|
|
||||||
verbose_name="Utilisateur",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to=settings.AUTH_USER_MODEL,
|
|
||||||
verbose_name="Utilisateur",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="date",
|
|
||||||
field=models.DateField(default=datetime.date.today, verbose_name="Date"),
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name="Account",
|
name="Account",
|
||||||
fields=[
|
fields=[
|
||||||
|
@ -338,333 +103,47 @@ class Migration(migrations.Migration):
|
||||||
"ordering": ["-default", "name"],
|
"ordering": ["-default", "name"],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.CreateModel(
|
||||||
model_name="snapshot",
|
name="Transaction",
|
||||||
name="account",
|
fields=[
|
||||||
field=models.ForeignKey(
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
on_delete=django.db.models.deletion.SET_NULL,
|
|
||||||
to="main.account",
|
|
||||||
verbose_name="Account",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="snapshot",
|
|
||||||
options={
|
|
||||||
"ordering": ["-date"],
|
|
||||||
"verbose_name": "Statement",
|
|
||||||
"verbose_name_plural": "Statements",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="diff",
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="previous",
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="start_date",
|
|
||||||
field=models.DateField(
|
|
||||||
default=datetime.date.today, verbose_name="Start date"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="start_value",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2, default=0, max_digits=12, verbose_name="Start value"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="date",
|
|
||||||
field=models.DateField(
|
|
||||||
default=datetime.date.today, verbose_name="End date"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="value",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2, default=0, max_digits=12, verbose_name="End value"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="diff",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
editable=False,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Différence",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="account",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="main.account",
|
|
||||||
verbose_name="Account",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="sum",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
editable=False,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Transaction difference",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="snapshot",
|
|
||||||
options={
|
|
||||||
"ordering": ["-date"],
|
|
||||||
"verbose_name": "Relevé",
|
|
||||||
"verbose_name_plural": "Relevés",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="category",
|
|
||||||
name="icon",
|
|
||||||
field=models.CharField(
|
|
||||||
default="folder",
|
|
||||||
max_length=64,
|
|
||||||
validators=[
|
|
||||||
django.core.validators.RegexValidator(
|
|
||||||
re.compile("^[-a-zA-Z0-9_]+\\Z"),
|
|
||||||
(
|
(
|
||||||
"Enter a valid “slug” consisting of letters, numbers, "
|
"id",
|
||||||
"underscores or hyphens."
|
models.UUIDField(
|
||||||
),
|
default=uuid.uuid4,
|
||||||
"invalid",
|
|
||||||
)
|
|
||||||
],
|
|
||||||
verbose_name="Icône",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="account",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="main.account",
|
|
||||||
verbose_name="Compte",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="date",
|
|
||||||
field=models.DateField(
|
|
||||||
default=datetime.date.today, verbose_name="Date de fin"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="start_date",
|
|
||||||
field=models.DateField(
|
|
||||||
default=datetime.date.today, verbose_name="Date de début"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="start_value",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Valeur de début",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="sum",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
editable=False,
|
editable=False,
|
||||||
max_digits=12,
|
primary_key=True,
|
||||||
verbose_name="Différence des transactions",
|
serialize=False,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
(
|
||||||
model_name="snapshot",
|
"name",
|
||||||
name="value",
|
models.CharField(
|
||||||
field=models.DecimalField(
|
default="Transaction", max_length=256, verbose_name="Name"
|
||||||
decimal_places=2, default=0, max_digits=12, verbose_name="Valeur de fin"
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
(
|
||||||
name="category",
|
"description",
|
||||||
options={
|
models.TextField(blank=True, null=True, verbose_name="Description"),
|
||||||
"ordering": ["name"],
|
|
||||||
"verbose_name": "Category",
|
|
||||||
"verbose_name_plural": "Categories",
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
(
|
||||||
name="invoice",
|
"value",
|
||||||
options={"verbose_name": "Invoice", "verbose_name_plural": "Invoices"},
|
models.DecimalField(
|
||||||
),
|
decimal_places=2, default=0, max_digits=12, verbose_name="Value"
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="snapshot",
|
|
||||||
options={
|
|
||||||
"ordering": ["-date"],
|
|
||||||
"verbose_name": "Statement",
|
|
||||||
"verbose_name_plural": "Statements",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name="category",
|
|
||||||
name="icon",
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="category",
|
|
||||||
name="name",
|
|
||||||
field=models.CharField(
|
|
||||||
default="Category", max_length=64, verbose_name="Name"
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
(
|
||||||
model_name="category",
|
"date",
|
||||||
name="user",
|
models.DateField(default=datetime.date.today, verbose_name="Date"),
|
||||||
field=models.ForeignKey(
|
),
|
||||||
editable=False,
|
(
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
"trader",
|
||||||
to=settings.AUTH_USER_MODEL,
|
models.CharField(
|
||||||
verbose_name="User",
|
blank=True, max_length=128, null=True, verbose_name="Trader"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
(
|
||||||
model_name="invoice",
|
"category",
|
||||||
name="file",
|
models.ForeignKey(
|
||||||
field=models.FileField(
|
|
||||||
max_length=128,
|
|
||||||
upload_to=main.utils.get_path,
|
|
||||||
validators=[django.core.validators.FileExtensionValidator(["pdf"])],
|
|
||||||
verbose_name="File",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="invoice",
|
|
||||||
name="name",
|
|
||||||
field=models.CharField(
|
|
||||||
default="Invoice", max_length=256, verbose_name="Name"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="invoice",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to=settings.AUTH_USER_MODEL,
|
|
||||||
verbose_name="User",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="account",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="main.account",
|
|
||||||
verbose_name="Account",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="date",
|
|
||||||
field=models.DateField(
|
|
||||||
default=datetime.date.today, verbose_name="End date"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="diff",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
editable=False,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Difference",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="file",
|
|
||||||
field=models.FileField(
|
|
||||||
blank=True,
|
|
||||||
default="",
|
|
||||||
max_length=256,
|
|
||||||
upload_to=main.utils.get_path,
|
|
||||||
validators=[django.core.validators.FileExtensionValidator(["pdf"])],
|
|
||||||
verbose_name="File",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="start_date",
|
|
||||||
field=models.DateField(
|
|
||||||
default=datetime.date.today, verbose_name="Start date"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="start_value",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2, default=0, max_digits=12, verbose_name="Start value"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="sum",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2,
|
|
||||||
default=0,
|
|
||||||
editable=False,
|
|
||||||
max_digits=12,
|
|
||||||
verbose_name="Transaction difference",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to=settings.AUTH_USER_MODEL,
|
|
||||||
verbose_name="User",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="snapshot",
|
|
||||||
name="value",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2, default=0, max_digits=12, verbose_name="End value"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="transaction",
|
|
||||||
name="account",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
|
||||||
to="main.account",
|
|
||||||
verbose_name="Account",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="transaction",
|
|
||||||
name="category",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
on_delete=django.db.models.deletion.SET_NULL,
|
on_delete=django.db.models.deletion.SET_NULL,
|
||||||
|
@ -672,87 +151,199 @@ class Migration(migrations.Migration):
|
||||||
verbose_name="Category",
|
verbose_name="Category",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
(
|
||||||
model_name="transaction",
|
"real_date",
|
||||||
name="name",
|
models.DateField(blank=True, null=True, verbose_name="Real date"),
|
||||||
field=models.CharField(
|
|
||||||
default="Transaction", max_length=256, verbose_name="Name"
|
|
||||||
),
|
),
|
||||||
),
|
(
|
||||||
migrations.AlterField(
|
"payment",
|
||||||
model_name="transaction",
|
models.CharField(
|
||||||
name="payment",
|
|
||||||
field=models.CharField(
|
|
||||||
blank=True, max_length=128, null=True, verbose_name="Payment"
|
blank=True, max_length=128, null=True, verbose_name="Payment"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
(
|
||||||
model_name="transaction",
|
"account",
|
||||||
name="real_date",
|
models.ForeignKey(
|
||||||
field=models.DateField(blank=True, null=True, verbose_name="Real date"),
|
editable=False,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to="main.account",
|
||||||
|
verbose_name="Account",
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
),
|
||||||
model_name="transaction",
|
(
|
||||||
name="snapshot",
|
"snapshot",
|
||||||
field=models.ForeignKey(
|
models.ForeignKey(
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
to="main.snapshot",
|
to="main.snapshot",
|
||||||
verbose_name="Statement",
|
verbose_name="Statement",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
(
|
||||||
model_name="transaction",
|
"user",
|
||||||
name="trader",
|
models.ForeignKey(
|
||||||
field=models.CharField(
|
|
||||||
blank=True, max_length=128, null=True, verbose_name="Trader"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="transaction",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey(
|
|
||||||
editable=False,
|
editable=False,
|
||||||
on_delete=django.db.models.deletion.CASCADE,
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
to=settings.AUTH_USER_MODEL,
|
to=settings.AUTH_USER_MODEL,
|
||||||
verbose_name="User",
|
verbose_name="User",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
],
|
||||||
model_name="transaction",
|
|
||||||
name="value",
|
|
||||||
field=models.DecimalField(
|
|
||||||
decimal_places=2, default=0, max_digits=12, verbose_name="Value"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="invoice",
|
|
||||||
options={
|
|
||||||
"ordering": ["transaction", "name"],
|
|
||||||
"verbose_name": "Invoice",
|
|
||||||
"verbose_name_plural": "Invoices",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="snapshot",
|
|
||||||
options={
|
|
||||||
"ordering": ["-date", "account"],
|
|
||||||
"verbose_name": "Statement",
|
|
||||||
"verbose_name_plural": "Statements",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.AlterModelOptions(
|
|
||||||
name="transaction",
|
|
||||||
options={
|
options={
|
||||||
"ordering": ["-date", "snapshot"],
|
"ordering": ["-date", "snapshot"],
|
||||||
"verbose_name": "Transaction",
|
"verbose_name": "Transaction",
|
||||||
"verbose_name_plural": "Transactions",
|
"verbose_name_plural": "Transactions",
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.CreateModel(
|
||||||
model_name="category",
|
name="Invoice",
|
||||||
name="icon",
|
fields=[
|
||||||
field=models.SlugField(
|
(
|
||||||
default="folder", max_length=24, verbose_name="Icon"
|
"id",
|
||||||
|
models.UUIDField(
|
||||||
|
default=uuid.uuid4,
|
||||||
|
editable=False,
|
||||||
|
primary_key=True,
|
||||||
|
serialize=False,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"name",
|
||||||
|
models.CharField(
|
||||||
|
default="Invoice", max_length=256, verbose_name="Name"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"file",
|
||||||
|
models.FileField(
|
||||||
|
max_length=128,
|
||||||
|
upload_to=main.utils.get_path,
|
||||||
|
validators=[
|
||||||
|
django.core.validators.FileExtensionValidator(["pdf"])
|
||||||
|
],
|
||||||
|
verbose_name="File",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"transaction",
|
||||||
|
models.ForeignKey(
|
||||||
|
editable=False,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to="main.transaction",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"user",
|
||||||
|
models.ForeignKey(
|
||||||
|
editable=False,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to=settings.AUTH_USER_MODEL,
|
||||||
|
verbose_name="User",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
"ordering": ["transaction", "name"],
|
||||||
|
"verbose_name": "Invoice",
|
||||||
|
"verbose_name_plural": "Invoices",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name="Snapshot",
|
||||||
|
fields=[
|
||||||
|
(
|
||||||
|
"id",
|
||||||
|
models.UUIDField(
|
||||||
|
default=uuid.uuid4,
|
||||||
|
editable=False,
|
||||||
|
primary_key=True,
|
||||||
|
serialize=False,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"date",
|
||||||
|
models.DateField(
|
||||||
|
default=datetime.date.today, verbose_name="End date"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"value",
|
||||||
|
models.DecimalField(
|
||||||
|
decimal_places=2,
|
||||||
|
default=0,
|
||||||
|
max_digits=12,
|
||||||
|
verbose_name="End value",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"file",
|
||||||
|
models.FileField(
|
||||||
|
blank=True,
|
||||||
|
default="",
|
||||||
|
max_length=256,
|
||||||
|
upload_to=main.utils.get_path,
|
||||||
|
validators=[
|
||||||
|
django.core.validators.FileExtensionValidator(["pdf"])
|
||||||
|
],
|
||||||
|
verbose_name="File",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"user",
|
||||||
|
models.ForeignKey(
|
||||||
|
editable=False,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to=settings.AUTH_USER_MODEL,
|
||||||
|
verbose_name="User",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"account",
|
||||||
|
models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to="main.account",
|
||||||
|
verbose_name="Account",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"start_date",
|
||||||
|
models.DateField(
|
||||||
|
default=datetime.date.today, verbose_name="Start date"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"start_value",
|
||||||
|
models.DecimalField(
|
||||||
|
decimal_places=2,
|
||||||
|
default=0,
|
||||||
|
max_digits=12,
|
||||||
|
verbose_name="Start value",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"diff",
|
||||||
|
models.DecimalField(
|
||||||
|
decimal_places=2,
|
||||||
|
default=0,
|
||||||
|
editable=False,
|
||||||
|
max_digits=12,
|
||||||
|
verbose_name="Difference",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"sum",
|
||||||
|
models.DecimalField(
|
||||||
|
decimal_places=2,
|
||||||
|
default=0,
|
||||||
|
editable=False,
|
||||||
|
max_digits=12,
|
||||||
|
verbose_name="Transaction difference",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
"ordering": ["-date", "account"],
|
||||||
|
"verbose_name": "Statement",
|
||||||
|
"verbose_name_plural": "Statements",
|
||||||
|
},
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue