X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/09f311cf21633def6e6eda0549633cd07b363cf2..6ed1d78c6ca14fd002c7a00867d1964e0c4ea4a8:/src/catalogue/models/tag.py diff --git a/src/catalogue/models/tag.py b/src/catalogue/models/tag.py index 830f29f69..c6b6f2663 100644 --- a/src/catalogue/models/tag.py +++ b/src/catalogue/models/tag.py @@ -166,6 +166,10 @@ class Tag(TagBase): else: return '' + @property + def category_plural(self): + return self.category + 's' + @permalink def get_absolute_url(self): return 'tagged_object_list', [self.url_chunk] @@ -230,7 +234,7 @@ class Tag(TagBase): @staticmethod def tags_from_info(info): - from fnpdjango.utils.text.slughifi import slughifi + from slugify import slugify from sortify import sortify meta_tags = [] categories = (('kinds', 'kind'), ('genres', 'genre'), ('authors', 'author'), ('epochs', 'epoch')) @@ -251,7 +255,7 @@ class Tag(TagBase): tag_name = tag_name.readable() if lang == settings.LANGUAGE_CODE: # Allow creating new tag, if it's in default language. - tag, created = Tag.objects.get_or_create(slug=slughifi(tag_name), category=category) + tag, created = Tag.objects.get_or_create(slug=slugify(tag_name), category=category) if created: tag_name = unicode(tag_name) tag.name = tag_name