X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/57e98a5807465f9494e5006e16860f16abbf4136..e078d02874b3f4aa50ee2488b83b8e0a4cba8fe7:/apps/catalogue/views.py diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 01600f5bc..fad77751e 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -16,6 +16,7 @@ from django.utils.datastructures import SortedDict from django.utils.http import urlquote_plus from django.utils import translation from django.utils.translation import ugettext as _ +from django.views.decorators.cache import never_cache from ajaxable.utils import JSONResponse, AjaxableFormView @@ -95,6 +96,7 @@ def differentiate_tags(request, tags, ambiguous_slugs): context_instance=RequestContext(request)) +@never_cache def tagged_object_list(request, tags=''): try: tags = models.Tag.get_tag_list(tags) @@ -202,6 +204,7 @@ def book_fragments(request, slug, theme_slug): context_instance=RequestContext(request)) +@never_cache def book_detail(request, slug): try: book = models.Book.objects.get(slug=slug) @@ -243,10 +246,11 @@ def player(request, slug): else: have_oggs = False audiobooks.append(media) - print audiobooks projects = sorted(projects) + extra_info = book.get_extra_info_value() + return render_to_response('catalogue/player.html', locals(), context_instance=RequestContext(request)) @@ -555,10 +559,15 @@ class CustomPDFFormView(AjaxableFormView): from copy import copy if request.method == 'POST': request.GET = copy(request.GET) - request.GET['next'] = "%s?%s" % (reverse('catalogue.views.download_custom_pdf', args=[request.GET['slug']]), + request.GET['next'] = "%s?%s" % (reverse('catalogue.views.download_custom_pdf', args=[request.GET.get('slug')]), request.POST.urlencode()) return super(CustomPDFFormView, self).__call__(request) + def get_object(self, request): + return get_object_or_404(models.Book, slug=request.GET.get('slug')) + + def context_description(self, request, obj): + return obj.pretty_title() def success(self, *args): pass