from ajaxable.utils import AjaxableFormView
from club.models import Membership
+from annoy.models import DynamicTextInsert
from pdcounter import views as pdcounter_views
from picture.models import Picture, PictureArea
from catalogue import constants
if not book.has_html_file():
raise Http404
- return render(request, 'catalogue/book_text.html', {'book': book})
+ with book.html_file.open('r') as f:
+ book_text = f.read()
+
+ return render(request, 'catalogue/book_text.html', {
+ 'book': book,
+ 'book_text': book_text,
+ 'inserts': DynamicTextInsert.objects.all()
+ })
# =========
def get_isbn(request, book_format, slug):
book = Book.objects.get(slug=slug)
- return HttpResponse(book.extra_info.get('isbn_%s' % book_format))
+ return HttpResponse(book.get_extra_info_json().get('isbn_%s' % book_format))