diff options
author | hardythe1 | 2014-03-15 17:28:43 +0530 |
---|---|---|
committer | hardythe1 | 2014-03-15 17:28:43 +0530 |
commit | cff25a4506d4f4feb20b515a64a5a16cd6463ba0 (patch) | |
tree | 49ee0726be4f37697b6bdc187cd8bf25e78f9d52 /tbc | |
parent | 49cb7bc912f4f228ea99451a4f59550ed701c91b (diff) | |
download | Python-TBC-Interface-cff25a4506d4f4feb20b515a64a5a16cd6463ba0.tar.gz Python-TBC-Interface-cff25a4506d4f4feb20b515a64a5a16cd6463ba0.tar.bz2 Python-TBC-Interface-cff25a4506d4f4feb20b515a64a5a16cd6463ba0.zip |
solving issue with browsing books
Diffstat (limited to 'tbc')
-rw-r--r-- | tbc/views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tbc/views.py b/tbc/views.py index e4a818f..d45214d 100644 --- a/tbc/views.py +++ b/tbc/views.py @@ -488,7 +488,10 @@ def BrowseBooks(request): context['reviewer'] = request.user else: context['user'] = request.user - if request.method == 'POST': + books = Book.objects.all() + for book in books: + images.append(ScreenShots.objects.filter(book=book)[0]) + """if request.method == 'POST': category = request.POST['category'] if category == "all": books = Book.objects.filter(approved=True) @@ -500,10 +503,11 @@ def BrowseBooks(request): books = Book.objects.all() for book in books: images.append(ScreenShots.objects.filter(book=book)[0]) - context.update(csrf(request)) + context.update(csrf(request))""" for i in range(len(books)): obj = {'book':books[i], 'image':images[i]} book_images.append(obj) + context.update(csrf(request)) context['items'] = book_images context['category'] = category return render_to_response('tbc/browse-books.html', context) |