Replace icon field with uicon in backend
This commit is contained in:
parent
71269377b4
commit
629c993072
3 changed files with 76 additions and 8 deletions
|
@ -21,7 +21,7 @@ class AccountForm(NummiForm):
|
|||
model = Account
|
||||
fields = [
|
||||
"name",
|
||||
"icon",
|
||||
"uicon",
|
||||
"default",
|
||||
]
|
||||
|
||||
|
@ -31,7 +31,7 @@ class CategoryForm(NummiForm):
|
|||
model = Category
|
||||
fields = [
|
||||
"name",
|
||||
"icon",
|
||||
"uicon",
|
||||
"budget",
|
||||
]
|
||||
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
# Generated by Django 4.1.4 on 2023-04-19 08:00
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("main", "0024_account_default"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="account",
|
||||
options={
|
||||
"ordering": ["-default", "name"],
|
||||
"verbose_name": "Account",
|
||||
"verbose_name_plural": "Accounts",
|
||||
},
|
||||
),
|
||||
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={
|
||||
"ordering": ["-date", "snapshot"],
|
||||
"verbose_name": "Transaction",
|
||||
"verbose_name_plural": "Transactions",
|
||||
},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="account",
|
||||
name="icon",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="category",
|
||||
name="icon",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="uicon",
|
||||
field=models.SlugField(
|
||||
allow_unicode=True, default="🏦", max_length=1, verbose_name="Icon"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="category",
|
||||
name="uicon",
|
||||
field=models.SlugField(
|
||||
allow_unicode=True, default="📂", max_length=1, verbose_name="Icon"
|
||||
),
|
||||
),
|
||||
]
|
|
@ -43,9 +43,10 @@ def get_path(instance, filename):
|
|||
class Account(CustomModel):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=64, default=_("Account"), verbose_name=_("Name"))
|
||||
icon = models.SlugField(
|
||||
max_length=64,
|
||||
default="building-columns",
|
||||
uicon = models.SlugField(
|
||||
max_length=1,
|
||||
default="🏦",
|
||||
allow_unicode=True,
|
||||
verbose_name=_("Icon"),
|
||||
)
|
||||
default = models.BooleanField(default=False, verbose_name=_("Default"))
|
||||
|
@ -96,9 +97,10 @@ class Category(CustomModel):
|
|||
name = models.CharField(
|
||||
max_length=64, default=_("Category"), verbose_name=_("Name")
|
||||
)
|
||||
icon = models.SlugField(
|
||||
max_length=64,
|
||||
default="folder",
|
||||
uicon = models.SlugField(
|
||||
max_length=1,
|
||||
default="📂",
|
||||
allow_unicode=True,
|
||||
verbose_name=_("Icon"),
|
||||
)
|
||||
budget = models.BooleanField(default=True, verbose_name=_("Budget"))
|
||||
|
|
Loading…
Reference in a new issue