From 93b31dabee5026e9601490359463698b1df7ca0b Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 19 Apr 2023 10:08:41 +0200 Subject: [PATCH] Fix uicon field type --- ...lter_account_uicon_alter_category_uicon.py | 22 +++++++++++++++++++ nummi/main/models.py | 6 ++--- 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 nummi/main/migrations/0026_alter_account_uicon_alter_category_uicon.py diff --git a/nummi/main/migrations/0026_alter_account_uicon_alter_category_uicon.py b/nummi/main/migrations/0026_alter_account_uicon_alter_category_uicon.py new file mode 100644 index 0000000..917a27f --- /dev/null +++ b/nummi/main/migrations/0026_alter_account_uicon_alter_category_uicon.py @@ -0,0 +1,22 @@ +# Generated by Django 4.1.4 on 2023-04-19 08:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("main", "0025_alter_account_options_alter_invoice_options_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="account", + name="uicon", + field=models.CharField(default="🏦", max_length=1, verbose_name="Icon"), + ), + migrations.AlterField( + model_name="category", + name="uicon", + field=models.CharField(default="📂", max_length=1, verbose_name="Icon"), + ), + ] diff --git a/nummi/main/models.py b/nummi/main/models.py index 556acbe..fd07b4b 100644 --- a/nummi/main/models.py +++ b/nummi/main/models.py @@ -43,10 +43,9 @@ 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")) - uicon = models.SlugField( + uicon = models.CharField( max_length=1, default="🏦", - allow_unicode=True, verbose_name=_("Icon"), ) default = models.BooleanField(default=False, verbose_name=_("Default")) @@ -97,10 +96,9 @@ class Category(CustomModel): name = models.CharField( max_length=64, default=_("Category"), verbose_name=_("Name") ) - uicon = models.SlugField( + uicon = models.CharField( max_length=1, default="📂", - allow_unicode=True, verbose_name=_("Icon"), ) budget = models.BooleanField(default=True, verbose_name=_("Budget"))