X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/8559c95597de98e8f6c580e97224ed3ecc9dc5c0..03b16118bd180d3c09452174fd2d4546945d0c48:/catalogue/models.py?ds=sidebyside diff --git a/catalogue/models.py b/catalogue/models.py index b49747b18..483741be8 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -54,6 +54,14 @@ class Tag(TagBase): def __unicode__(self): return self.name + @staticmethod + def get_tag_list(tags): + if isinstance(tags, basestring): + tag_slugs = tags.split('/') + return [Tag.objects.get(slug=slug) for slug in tag_slugs] + else: + return TagBase.get_tag_list(tags) + class Book(models.Model): title = models.CharField(_('title'), max_length=120)