X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/676af187437d5baf0543cadc200efb476b062e4b..8af0d74b3799a691fb29468f9ade870a28ff2622:/apps/funding/models.py diff --git a/apps/funding/models.py b/apps/funding/models.py index ae034f06d..2c2820d58 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')