1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-19 15:43:45 +02:00
RPGnotes/factions/models.py
2022-11-19 22:46:41 +01:00

22 lines
632 B
Python

from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from common.models import DescriptionModel, HistoryModel, NameSlugModel, AliasModel
from search.utils import NameSearchIndex
class Faction(NameSlugModel, DescriptionModel, AliasModel, HistoryModel):
class Meta:
ordering = ["name"]
verbose_name = _("Faction")
verbose_name_plural = _("Factions")
indexes = [
NameSearchIndex
]
def get_absolute_url(self):
return reverse('factiondetail', args=[self.slug])
@property
def graphkey(self):
return f"fac{self.pk}"