X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/b2d342589a7889a3b096e7192453d53bd28eed7d..1ca64302e8447c9715ab42dd1a33075f312e6059:/src/picture/models.py diff --git a/src/picture/models.py b/src/picture/models.py index 020d3f565..5bc8d49d9 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -79,9 +79,9 @@ class Picture(models.Model): _('sort key by author'), max_length=120, db_index=True, editable=False, default=u'') created_at = models.DateTimeField(_('creation date'), auto_now_add=True, db_index=True) changed_at = models.DateTimeField(_('creation date'), auto_now=True, db_index=True) - xml_file = models.FileField('xml_file', upload_to="xml", storage=picture_storage) - image_file = ImageField(_('image_file'), upload_to="images", storage=picture_storage) - html_file = models.FileField('html_file', upload_to="html", storage=picture_storage) + xml_file = models.FileField(_('xml file'), upload_to="xml", storage=picture_storage) + image_file = ImageField(_('image file'), upload_to="images", storage=picture_storage) + html_file = models.FileField(_('html file'), upload_to="html", storage=picture_storage) areas_json = jsonfield.JSONField(_('picture areas JSON'), default={}, editable=False) extra_info = jsonfield.JSONField(_('extra information'), default={}) culturepl_link = models.CharField(blank=True, max_length=240) @@ -127,6 +127,12 @@ 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 self.tag_unicode('author') + @permalink def get_absolute_url(self): return 'picture.views.picture_detail', [self.slug]