From: Marcin Koziej Date: Thu, 19 Jan 2012 16:19:52 +0000 (+0100) Subject: pass context X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/01dffbea70cb55d8ebbbcfa8976a913df079f47c?hp=85f97b6322eacc6fa89788aba7998fc485f85cfc pass context --- diff --git a/apps/search/templatetags/search_tags.py b/apps/search/templatetags/search_tags.py index 03e33c8d2..8ae648d1d 100644 --- a/apps/search/templatetags/search_tags.py +++ b/apps/search/templatetags/search_tags.py @@ -22,10 +22,10 @@ from catalogue.models import Book 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) - vals = book_wide(book) + vals = book_wide(context, book) # snippets = [] # for hit in result.hits: