django-watson comes with a template tag library called watson
. You can include this template tag library in your templates with the following code:
This library contains the following template tags and filters:
Renders a list of search results in a page. If the project is using Django 1.4 or above, the object
of each search entry will be prefetched using prefetch_related
. The results will be rendered using the "watson/includes/search_results.html"
template.
{% search_results search_entry_list %}
QuerySet
of SearchEntry
.Renders a single search result. The results will be rendered using a template whose name corresponds to the type of the object referenced by the search entry. The template will be chosen according the to following naming scheme:
( "watson/includes/search_result_{app_label}_{model_name}.html", "watson/includes/search_result_{app_label}.html", "watson/includes/search_result_item.html", )
The template tag is useful for rendering different formatting depending on the type of the search entry.
{% search_result_item search_entry %}
SearchEntry
instance.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4