X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/592c9401b18118e01de250d44878b9289b138f9c..eb383b976ed875888b261bf5901ee484aa2dcf8f:/src/picture/models.py diff --git a/src/picture/models.py b/src/picture/models.py index 7ccd97c0c..b9ddcae9b 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -22,7 +22,7 @@ import re from PIL import Image -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from newtagging import managers from os import path @@ -136,6 +136,15 @@ class Picture(models.Model): def authors(self): return self.tags.filter(category='author') + def epochs(self): + return self.tags.filter(category='epoch') + + def genres(self): + return self.tags.filter(category='genre') + + def kinds(self): + return self.tags.filter(category='kind') + def tag_unicode(self, category): relations = prefetched_relations(self, category) if relations: