Update fields icon to slugfield

This commit is contained in:
Edgar P. Burkhart 2022-12-31 09:53:30 +01:00
parent 25e9751de2
commit ce28f6d0b6
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 29 additions and 4 deletions

View file

@ -0,0 +1,27 @@
# 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"
),
),
]

View file

@ -33,11 +33,10 @@ class CustomModel(UserModel):
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.CharField(
icon = models.SlugField(
max_length=64,
default="building-columns",
verbose_name=_("Icon"),
validators=[validate_slug],
)
def __str__(self):
@ -79,11 +78,10 @@ class Category(CustomModel):
name = models.CharField(
max_length=64, default=_("Category"), verbose_name=_("Name")
)
icon = models.CharField(
icon = models.SlugField(
max_length=64,
default="folder",
verbose_name=_("Icon"),
validators=[validate_slug],
)
budget = models.BooleanField(default=True, verbose_name=_("Budget"))