X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/676af187437d5baf0543cadc200efb476b062e4b..5e0d7de506e280f66f4bcc42e2218a706a335138:/apps/funding/models.py diff --git a/apps/funding/models.py b/apps/funding/models.py index ae034f06d..5f2f17d73 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -24,7 +24,13 @@ class Offer(models.Model): redakcja_url = models.URLField(_('redakcja URL'), blank=True) book = models.ForeignKey(Book, null=True, blank=True, help_text=_('Published book.')) - + cover = models.ImageField(_('cover'), upload_to = 'funding/covers') + + def cover_img_tag(self): + return u'' % self.cover.url + cover_img_tag.short_description = _('Cover preview') + cover_img_tag.allow_tags = True + class Meta: verbose_name = _('offer') verbose_name_plural = _('offers')