1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-19 15:43:45 +02:00

add loottype slug

This commit is contained in:
Lukas Winkler 2022-11-19 18:05:31 +01:00
parent d6478c6823
commit cdf4c8ac60
Signed by: lukas
GPG key ID: 54DE4D798D244853
2 changed files with 21 additions and 3 deletions

View file

@ -0,0 +1,19 @@
# Generated by Django 4.1.3 on 2022-11-19 17:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("loot", "0014_loottype_historicalloot_type_loot_type"),
]
operations = [
migrations.AddField(
model_name="loottype",
name="slug",
field=models.SlugField(default="defaultslug", editable=False, unique=True),
preserve_default=False,
),
]

View file

@ -4,14 +4,13 @@ from django.utils.translation import gettext_lazy as _
from sorl.thumbnail import ImageField
from characters.models import Character
from common.models import DescriptionModel, HistoryModel, AliasModel
from common.models import DescriptionModel, HistoryModel, AliasModel, NameSlugModel
from locations.models import Location
from search.utils import NameSearchIndex
from utils.random_filename import get_file_path
class LootType(models.Model):
name = models.CharField(_("Name"), max_length=1000)
class LootType(NameSlugModel, models.Model):
def __str__(self):
return self.name