@register.inclusion_tag('catalogue/book_searched.html', takes_context=True)
def book_searched(context, result):
book = Book.objects.get(pk=result.book_id)
@register.inclusion_tag('catalogue/book_searched.html', takes_context=True)
def book_searched(context, result):
book = Book.objects.get(pk=result.book_id)
- vals['hits'] = filter(lambda h: 'fragment' in h or
- h['snippets'], result.hits)
+ hits = filter(lambda h: 'fragment' in h or
+ h['snippets'], result.hits)
hit['snippets'] = map(lambda s: s.replace("\n", "<br />").replace('---', '—'), hit['snippets'])
hit['snippets'] = map(lambda s: s.replace("\n", "<br />").replace('---', '—'), hit['snippets'])