diff options
author | hardythe1 | 2014-02-18 17:28:43 +0530 |
---|---|---|
committer | hardythe1 | 2014-02-18 17:28:43 +0530 |
commit | 547bc2ca4f9296262c03be5220c25dbca11f463b (patch) | |
tree | 1236cf20fd9807f0bb98cb05fa655da5493436b3 | |
parent | 8e31d566ab19680ccb1e06da1611e43ffd46624b (diff) | |
download | Python-TBC-Interface-547bc2ca4f9296262c03be5220c25dbca11f463b.tar.gz Python-TBC-Interface-547bc2ca4f9296262c03be5220c25dbca11f463b.tar.bz2 Python-TBC-Interface-547bc2ca4f9296262c03be5220c25dbca11f463b.zip |
correcting an error in browe books
-rw-r--r-- | tbc/templates/tbc/browse-books.html | 1 | ||||
-rw-r--r-- | tbc/views.py | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tbc/templates/tbc/browse-books.html b/tbc/templates/tbc/browse-books.html index 5996d93..e278eaa 100644 --- a/tbc/templates/tbc/browse-books.html +++ b/tbc/templates/tbc/browse-books.html @@ -16,6 +16,7 @@ function submitCategory() <form name="browseBooks" action="/browse-books/" method=POST enctype="multipart/form-data"> {% csrf_token %} <center><select name="category" id="category" onchange="submitCategory();"> + <option value="all">All</option> <option value="fluid mechanics">Fluid Mechanics</option> <option value="control systems">Control Theory & Control Systems</option> <option value="chemical engineering">Chemical Engineering</option> diff --git a/tbc/views.py b/tbc/views.py index e7c3171..762f0bd 100644 --- a/tbc/views.py +++ b/tbc/views.py @@ -473,6 +473,7 @@ def NotifyChanges(request, book_id=None): def BrowseBooks(request): context = {} + category = None if request.user.is_anonymous(): context['anonymous'] = True else: @@ -487,8 +488,7 @@ def BrowseBooks(request): for book in books: images.append(ScreenShots.objects.filter(book=book)[0]) else: - category = 'computer science' - books = Book.objects.filter(category='computer science') + books = Book.objects.all() for book in books: images.append(ScreenShots.objects.filter(book=book)[0]) context.update(csrf(request)) |