#6 uzupełnione metadane (wg makiety)
authorJan Szejko <j-sz@o2.pl>
Thu, 4 Feb 2016 14:47:31 +0000 (15:47 +0100)
committerJan Szejko <j-sz@o2.pl>
Thu, 4 Feb 2016 14:47:31 +0000 (15:47 +0100)
src/picture/models.py
src/picture/views.py

index f496726..5bc8d49 100644 (file)
@@ -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):
index 35e9b5f..c0be52e 100644 (file)
@@ -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,