add unique slug to keywords

This commit is contained in:
Christoph J. Scherr 2023-10-02 00:52:54 +02:00
parent a2fc4eb8b8
commit adac986018
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# Generated by Django 3.2.21 on 2023-10-01 22:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0010_auto_20230930_2331'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='thumbnail',
field=models.ImageField(blank=True, default='img/thumbnails/default.jpg', upload_to='img/thumbnails'),
),
migrations.AlterField(
model_name='category',
name='slug',
field=models.SlugField(unique=True),
),
]

View File

@ -0,0 +1,19 @@
# Generated by Django 3.2.21 on 2023-10-01 22:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('start', '0012_auto_20230930_2331'),
]
operations = [
migrations.AddField(
model_name='keyword',
name='slug',
field=models.SlugField(default='foo', unique=True),
preserve_default=False,
),
]

View File

@ -16,6 +16,7 @@ class Keyword(models.Model):
"""
this is the model that should contain searchable keywords
"""
slug = models.SlugField(unique=True)
text_de = models.CharField(max_length=40)
text_en = models.CharField(max_length=40)