From 0c966fecc8002d7413c25bbb03e961add58ca19c Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 4 Feb 2016 15:47:31 +0100 Subject: [PATCH] =?utf8?q?#6=20uzupe=C5=82nione=20metadane=20(wg=20makiety?= =?utf8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/picture/models.py | 5 ++++- src/picture/views.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/picture/models.py b/src/picture/models.py index f496726a3..5bc8d49d9 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -127,8 +127,11 @@ class Picture(models.Model): def author_str(self): return ", ".join(str(t) for t in self.tags.filter(category='author')) + def tag_unicode(self, category): + return ", ".join(unicode(t) for t in self.tags.filter(category=category)) + def author_unicode(self): - return ", ".join(unicode(t) for t in self.tags.filter(category='author')) + return self.tag_unicode('author') @permalink def get_absolute_url(self): diff --git a/src/picture/views.py b/src/picture/views.py index 35e9b5f8d..c0be52e2d 100644 --- a/src/picture/views.py +++ b/src/picture/views.py @@ -82,6 +82,10 @@ def picture_page(request, key=None): 'id': picture.id, 'title': picture.title, 'author': picture.author_unicode(), + 'epoch': picture.tag_unicode('epoch'), + 'kind': picture.tag_unicode('kind'), + 'genre': picture.tag_unicode('genre'), + 'style': picture.extra_info['style'], 'image_url': picture.image_file.url, 'width': picture.width, 'height': picture.height, -- 2.20.1