Compare commits
No commits in common. "34d5ce647c2b7e9a8cf1d4108a6b16a741bc19f1" and "25e9751de22861f77362ea6a0a1541f29060fa3a" have entirely different histories.
34d5ce647c
...
25e9751de2
3 changed files with 8 additions and 49 deletions
|
@ -24,26 +24,13 @@ class AccountForm(NummiForm):
|
||||||
class CategoryForm(NummiForm):
|
class CategoryForm(NummiForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Category
|
model = Category
|
||||||
fields = [
|
fields = "__all__"
|
||||||
"name",
|
|
||||||
"icon",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class TransactionForm(NummiForm):
|
class TransactionForm(NummiForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Transaction
|
model = Transaction
|
||||||
fields = [
|
fields = "__all__"
|
||||||
"snapshot",
|
|
||||||
"name",
|
|
||||||
"value",
|
|
||||||
"date",
|
|
||||||
"real_date",
|
|
||||||
"category",
|
|
||||||
"trader",
|
|
||||||
"payment",
|
|
||||||
"description",
|
|
||||||
]
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
_user = kwargs.get("user")
|
_user = kwargs.get("user")
|
||||||
|
@ -57,16 +44,13 @@ class InvoiceForm(NummiForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Invoice
|
model = Invoice
|
||||||
fields = [
|
fields = "__all__"
|
||||||
"name",
|
|
||||||
"file",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class SnapshotForm(NummiForm):
|
class SnapshotForm(NummiForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Snapshot
|
model = Snapshot
|
||||||
fields = ["account", "start_date", "date", "start_value", "value", "file"]
|
fields = "__all__"
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
_user = kwargs.get("user")
|
_user = kwargs.get("user")
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
# Generated by Django 4.1.4 on 2022-12-31 08:53
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("main", "0021_alter_account_options_alter_category_options_and_more"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="account",
|
|
||||||
name="icon",
|
|
||||||
field=models.SlugField(
|
|
||||||
default="building-columns", max_length=64, verbose_name="Icon"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="category",
|
|
||||||
name="icon",
|
|
||||||
field=models.SlugField(
|
|
||||||
default="folder", max_length=64, verbose_name="Icon"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -33,10 +33,11 @@ class CustomModel(UserModel):
|
||||||
class Account(CustomModel):
|
class Account(CustomModel):
|
||||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||||
name = models.CharField(max_length=64, default=_("Account"), verbose_name=_("Name"))
|
name = models.CharField(max_length=64, default=_("Account"), verbose_name=_("Name"))
|
||||||
icon = models.SlugField(
|
icon = models.CharField(
|
||||||
max_length=64,
|
max_length=64,
|
||||||
default="building-columns",
|
default="building-columns",
|
||||||
verbose_name=_("Icon"),
|
verbose_name=_("Icon"),
|
||||||
|
validators=[validate_slug],
|
||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -78,10 +79,11 @@ class Category(CustomModel):
|
||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
max_length=64, default=_("Category"), verbose_name=_("Name")
|
max_length=64, default=_("Category"), verbose_name=_("Name")
|
||||||
)
|
)
|
||||||
icon = models.SlugField(
|
icon = models.CharField(
|
||||||
max_length=64,
|
max_length=64,
|
||||||
default="folder",
|
default="folder",
|
||||||
verbose_name=_("Icon"),
|
verbose_name=_("Icon"),
|
||||||
|
validators=[validate_slug],
|
||||||
)
|
)
|
||||||
budget = models.BooleanField(default=True, verbose_name=_("Budget"))
|
budget = models.BooleanField(default=True, verbose_name=_("Budget"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue