Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 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

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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 Changed 3 years ago by anonymous

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.