Update fields icon to slugfield
This commit is contained in:
parent
25e9751de2
commit
ce28f6d0b6
2 changed files with 29 additions and 4 deletions
|
@ -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"
|
||||
),
|
||||
),
|
||||
]
|
|
@ -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"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue