Remove restrictions on category names

This commit is contained in:
Edgar P. Burkhart 2022-05-22 13:57:53 +02:00
parent b45150d4ff
commit b4e218f418
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 20 additions and 4 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2022-05-22 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("main", "0004_transaction_payment"),
]
operations = [
migrations.AlterField(
model_name="category",
name="name",
field=models.CharField(default="New Category", max_length=64),
),
]

View file

@ -2,14 +2,12 @@ from datetime import date
import uuid import uuid
from django.db import models from django.db import models
from django.forms import ModelForm from django.forms import ModelForm
from django.core.validators import validate_unicode_slug, FileExtensionValidator from django.core.validators import FileExtensionValidator
class Category(models.Model): class Category(models.Model):
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( name = models.CharField(max_length=64, default="New Category")
max_length=64, validators=[validate_unicode_slug], default="New Category"
)
icon = models.CharField(max_length=64, default="folder") icon = models.CharField(max_length=64, default="folder")
def __str__(self): def __str__(self):