X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c7c8dfb7ad2240ffc0135dbd9dd871c85f211a29..7f9492091585f0d14aa6ff66731a8cadb611fc43:/apps/catalogue/models.py
diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py
index feccaedf4..7bddbbd01 100644
--- a/apps/catalogue/models.py
+++ b/apps/catalogue/models.py
@@ -102,8 +102,8 @@ class Book(models.Model):
if self.odt_file:
formats.append(u'Plik ODT' % self.odt_file.url)
- self._short_html = render_to_string('catalogue/book_short.html',
- {'book': self, 'tags': tags, 'formats': formats})
+ self._short_html = unicode(render_to_string('catalogue/book_short.html',
+ {'book': self, 'tags': tags, 'formats': formats}))
self.save()
return mark_safe(self._short_html)
@@ -207,7 +207,7 @@ class Fragment(models.Model):
text = models.TextField()
short_text = models.TextField(editable=False)
_short_html = models.TextField(editable=False)
- anchor = models.IntegerField()
+ anchor = models.CharField(max_length=120)
book = models.ForeignKey(Book, related_name='fragments')
objects = models.Manager()
@@ -221,8 +221,8 @@ class Fragment(models.Model):
book_authors = [u'%s' % (tag.get_absolute_url(), tag.name)
for tag in self.book.tags if tag.category == 'author']
- self._short_html = render_to_string('catalogue/fragment_short.html',
- {'fragment': self, 'book': self.book, 'book_authors': book_authors})
+ self._short_html = unicode(render_to_string('catalogue/fragment_short.html',
+ {'fragment': self, 'book': self.book, 'book_authors': book_authors}))
self.save()
return mark_safe(self._short_html)