fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
65904b8
)
Fixed searching for books.
author
Marek Stępniowski
<marek@stepniowski.com>
Fri, 22 Aug 2008 15:07:45 +0000
(17:07 +0200)
committer
Marek Stępniowski
<marek@stepniowski.com>
Fri, 22 Aug 2008 15:07:45 +0000
(17:07 +0200)
catalogue/views.py
patch
|
blob
|
history
diff --git
a/catalogue/views.py
b/catalogue/views.py
index
0166133
..
ed0436e
100644
(file)
--- a/
catalogue/views.py
+++ b/
catalogue/views.py
@@
-39,6
+39,7
@@
def search(request):
print "%r, %r" % (query, tags)
try:
book = models.Book.objects.get(title=query)
print "%r, %r" % (query, tags)
try:
book = models.Book.objects.get(title=query)
+ return HttpResponseRedirect(book.get_absolute_url())
except models.Book.DoesNotExist:
return HttpResponseRedirect(reverse('catalogue.views.main_page'))
else:
except models.Book.DoesNotExist:
return HttpResponseRedirect(reverse('catalogue.views.main_page'))
else: