Skip to content

Commit

Permalink
Merge pull request #1252 from rhemzo/master
Browse files Browse the repository at this point in the history
Update tutorial.rst (closes #1251)

Thanks to @rhemzo for the patch
  • Loading branch information
acdha committed Oct 13, 2015
2 parents 6b61dc0 + 9fc143f commit 1bf81e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,19 @@ will likely differ)::
{% if query %}
<h3>Results</h3>

{% for result in page.object_list %}
{% for result in page_obj.object_list %}
<p>
<a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>
</p>
{% empty %}
<p>No results found.</p>
{% endfor %}

{% if page.has_previous or page.has_next %}
{% if page_obj.has_previous or page_obj.has_next %}
<div>
{% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
{% if page_obj.has_previous %}<a href="?q={{ query }}&amp;page={{ page_obj.previous_page_number }}">{% endif %}&laquo; Previous{% if page_obj.has_previous %}</a>{% endif %}
|
{% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
{% if page_obj.has_next %}<a href="?q={{ query }}&amp;page={{ page_obj.next_page_number }}">{% endif %}Next &raquo;{% if page_obj.has_next %}</a>{% endif %}
</div>
{% endif %}
{% else %}
Expand All @@ -339,7 +339,7 @@ will likely differ)::
</form>
{% endblock %}

Note that the ``page.object_list`` is actually a list of ``SearchResult``
Note that the ``page_obj.object_list`` is actually a list of ``SearchResult``
objects instead of individual models. These objects have all the data returned
from that record within the search index as well as score. They can also
directly access the model for the result via ``{{ result.object }}``. So the
Expand Down

0 comments on commit 1bf81e1

Please sign in to comment.