# from django.db.models import Q
# from django.utils.translation import ugettext as _
from catalogue.models import Book
+from catalogue.templatetags.catalogue_tags import book_short
import re
# from catalogue.forms import SearchForm
# from catalogue.utils import split_tags
snip = snip.replace("\n", "<br />").replace('---', '—')
hit['snippet'] = snip
- return {
- 'related': book.related_info(),
- 'book': book,
- 'main_link': book.get_absolute_url(),
- 'request': context.get('request'),
- 'hits': hits and zip(*hits)[1] or [],
- 'main_link': book.get_absolute_url(),
- }
+ ctx = book_short(context, book)
+ ctx['hits'] = hits and zip(*hits)[1] or []
+ return ctx