summaryrefslogtreecommitdiff
path: root/tbc
diff options
context:
space:
mode:
authorhardythe12014-03-15 17:42:43 +0530
committerhardythe12014-03-15 17:42:43 +0530
commitb86fd58944f5bd4c4fd766377feedf0f9efb2547 (patch)
tree924679a3e169e579660d38f0f3f70adf9b8fecc5 /tbc
parentcff25a4506d4f4feb20b515a64a5a16cd6463ba0 (diff)
downloadPython-TBC-Interface-b86fd58944f5bd4c4fd766377feedf0f9efb2547.tar.gz
Python-TBC-Interface-b86fd58944f5bd4c4fd766377feedf0f9efb2547.tar.bz2
Python-TBC-Interface-b86fd58944f5bd4c4fd766377feedf0f9efb2547.zip
solving issue with browsing books
Diffstat (limited to 'tbc')
-rw-r--r--tbc/views.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/tbc/views.py b/tbc/views.py
index d45214d..196a213 100644
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -488,22 +488,9 @@ def BrowseBooks(request):
context['reviewer'] = request.user
else:
context['user'] = request.user
- books = Book.objects.all()
+ books = Book.objects.filter(approved=True)
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)
- else:
- books = Book.objects.filter(category=category)
- for book in books:
- images.append(ScreenShots.objects.filter(book=book)[0])
- else:
- books = Book.objects.all()
- for book in books:
- images.append(ScreenShots.objects.filter(book=book)[0])
- context.update(csrf(request))"""
for i in range(len(books)):
obj = {'book':books[i], 'image':images[i]}
book_images.append(obj)