2021-10-03 16:44:54 +02:00
|
|
|
from datetime import date
|
|
|
|
|
|
|
|
from django.contrib.humanize.templatetags.humanize import ordinal
|
2022-04-11 22:43:06 +02:00
|
|
|
from django.contrib.postgres.indexes import GinIndex
|
2021-10-03 16:44:54 +02:00
|
|
|
from django.db import models
|
|
|
|
from django.urls import reverse
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
|
|
from common.models import DescriptionModel, HistoryModel, NameSlugModel
|
2022-04-11 22:43:06 +02:00
|
|
|
from search.utils import NameSearchIndex
|
2021-10-03 16:44:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Faction(NameSlugModel, DescriptionModel, HistoryModel):
|
|
|
|
|
|
|
|
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])
|
|
|
|
|