pass context
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 19 Jan 2012 16:19:52 +0000 (17:19 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 19 Jan 2012 16:19:52 +0000 (17:19 +0100)
apps/search/templatetags/search_tags.py

index 03e33c8..8ae648d 100644 (file)
@@ -22,10 +22,10 @@ from catalogue.models import Book
 register = template.Library()
 
 
 register = template.Library()
 
 
-@register.inclusion_tag('catalogue/book_searched.html')
-def book_searched(result):
+@register.inclusion_tag('catalogue/book_searched.html', takes_context=True)
+def book_searched(context, result):
     book = Book.objects.get(pk=result.book_id)
     book = Book.objects.get(pk=result.book_id)
-    vals = book_wide(book)
+    vals = book_wide(context, book)
 
     # snippets = []
     # for hit in result.hits:
 
     # snippets = []
     # for hit in result.hits: