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:
parent
d6478c6823
commit
cdf4c8ac60
2 changed files with 21 additions and 3 deletions
19
loot/migrations/0015_loottype_slug.py
Normal file
19
loot/migrations/0015_loottype_slug.py
Normal 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,
|
||||
),
|
||||
]
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue