1
0
Fork 0
mirror of https://github.com/Findus23/lw1.at.git synced 2024-09-09 04:03:45 +02:00
lw1.at/lw1/tag.py
2022-08-17 19:09:56 +02:00

20 lines
424 B
Python

from dataclasses import dataclass
from lw1.utils import custom_slugify,Language
@dataclass
class Tag:
id: str
name_de: str
name_en: str
hidden: bool = False
def name_in_lang(self, lang: Language):
if lang == "de":
return self.name_de
else:
return self.name_en
def slug_in_lang(self, lang: Language):
return custom_slugify(self.name_in_lang(lang))