user = models.ForeignKey(User, blank=True, null=True)
book_count = models.IntegerField(_('book count'), default=0, blank=False, null=False)
+ gazeta_link = models.CharField(blank=True, max_length=240)
def has_description(self):
return len(self.description) > 0
_short_html = models.TextField(_('short HTML'), editable=False)
parent_number = models.IntegerField(_('parent number'), default=0)
extra_info = JSONField(_('extra information'))
+ gazeta_link = models.CharField(blank=True, max_length=240)
# Formats
xml_file = models.FileField(_('XML file'), upload_to=book_upload_path('xml'), blank=True)
if self.html_file:
formats.append(u'<a href="%s">Czytaj online</a>' % reverse('book_text', kwargs={'slug': self.slug}))
if self.pdf_file:
- formats.append(u'<a href="%s">Plik PDF</a>' % self.pdf_file.url)
+ formats.append(u'<a href="%s">PDF</a>' % self.pdf_file.url)
if self.odt_file:
- formats.append(u'<a href="%s">Plik ODT</a>' % self.odt_file.url)
+ formats.append(u'<a href="%s">ODT</a>' % self.odt_file.url)
if self.txt_file:
- formats.append(u'<a href="%s">Plik TXT</a>' % self.txt_file.url)
+ formats.append(u'<a href="%s">TXT</a>' % self.txt_file.url)
+ if self.mp3_file:
+ formats.append(u'<a href="%s">MP3</a>' % self.mp3_file.url)
+ if self.ogg_file:
+ formats.append(u'<a href="%s">OGG</a>' % self.ogg_file.url)
self._short_html = unicode(render_to_string('catalogue/book_short.html',
{'book': self, 'tags': tags, 'formats': formats}))