Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Optomized search results so that they don't have to hit the DB.

  • Loading branch information...
commit 8b182efce10c77b25b863740c7fe83b9dcfcef6d 1 parent 6ad5c64
@jacobian jacobian authored
View
2  django_website/docs/templates/docs/search.html
@@ -26,7 +26,7 @@
<div id="search-results">
{% for result in page.object_list %}
<h3>
- <a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>
+ <a href="{% url document-detail lang=result.lang version=result.version url=result.path %}">{{ result.title }}</a>
</h3>
<p>{% highlight result.text with query max_length 200 %}</p>
{% empty %}
View
1  django_website/docs/views.py
@@ -67,6 +67,7 @@ def __init__(self, **kwargs):
kwargs.update({
'template': 'docs/search.html',
'form_class': DocSearchForm,
+ 'load_all': False,
})
super(DocSearchView, self).__init__(**kwargs)
Please sign in to comment.
Something went wrong with that request. Please try again.