fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Offers have covers
[wolnelektury.git]
/
apps
/
funding
/
models.py
diff --git
a/apps/funding/models.py
b/apps/funding/models.py
index
ae034f0
..
5f2f17d
100644
(file)
--- 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.'))
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'<img src="%s" />' % 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')
class Meta:
verbose_name = _('offer')
verbose_name_plural = _('offers')