Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16667 closed Uncategorized (invalid)

Error in Pagination-Template?

Reported by: Aufwind Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

I am following your tutorial and the documentation to learn Django and I found, that the first template snippet on this page (https://docs.djangoproject.com/en/dev/topics/pagination/) is wrong. The first line must be

{% for contact in contacts.object_list %}

(like in the 1.3 Version of the Docs) and not

{% for contact in contacts %}

I was struggling with this for some hours until I found the solution that seemed to work. Please note, that I am an absolute beginner with Django. So bare with me if my guess is wrong and the fault was something else. Anyway I thought of opening a ticket may help but does not harm.

Greetings,
Aufwind

Change History (2)

comment:1 by Aymeric Augustin, 13 years ago

Resolution: invalid
Status: newclosed

In fact, this has changed between the current version of Django (1.3) and the upcoming, not-yet-released version (dev). The documentation page you linked contains this note:

Changed in Django Development version: Previously, you would need to use {% for contact in contacts.object_list %}, since the Page object was not iterable.

You must be using version 1.3 of Django; make sure you always read version 1.3 of the docs. There's a link at the top of each page to get the same page for a different version of Django. The "Documentation" link at the top also points to the stable version, currently 1.3.

Please provide more information if this doesn't resolve your problem.

comment:2 by anonymous, 13 years ago

I wasn't aware of that. Thanks for pointing this out!

Note: See TracTickets for help on using tickets.
Back to Top