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

23 lines
632 B
Python
Raw Normal View History

2021-10-03 16:44:54 +02:00
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
2022-07-05 18:37:21 +02:00
from common.models import DescriptionModel, HistoryModel, NameSlugModel, AliasModel
2022-04-11 22:43:06 +02:00
from search.utils import NameSearchIndex
2021-10-03 16:44:54 +02:00
2022-07-05 18:37:21 +02:00
class Faction(NameSlugModel, DescriptionModel, AliasModel, HistoryModel):
2021-10-03 16:44:54 +02:00
class Meta:
ordering = ["name"]
verbose_name = _("Faction")
verbose_name_plural = _("Factions")
2022-04-11 22:43:06 +02:00
indexes = [
NameSearchIndex
]
2021-10-03 16:44:54 +02:00
def get_absolute_url(self):
return reverse('factiondetail', args=[self.slug])
2022-11-19 22:46:41 +01:00
@property
def graphkey(self):
return f"fac{self.pk}"