Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

note on dotted variable names #43

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions docs/usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ installation, which is covered in INSTALL.txt in this same directory.)
{% autopaginate object_list 10 %}

Note that this replaces ``object_list`` with the list for the current page, so
you can iterate over the ``object_list`` like you normally would.
you can iterate over the ``object_list`` like you normally would.



6. Now you want to display the current page and the available pages, so
somewhere after having used autopaginate, use the paginate inclusion tag:

Expand All @@ -70,6 +70,21 @@ That's it! You have now paginated ``object_list`` and given users of the site
a way to navigate between the different pages--all without touching your views.


Dotted variable names
---------------------

Note also that *pagination won't work for dotted variable names*. For example,
you won't be able to paginate a list called ``some_thing.object_list``.

Instead, you can assign ``some_thing.object_list`` to another variable using
{% with %}::

{% with some_thing.object_list as object_list %}
{% autopaginate object_list %}
{% paginate %}
{% endwith %}


A Note About Uploads
--------------------

Expand Down