Code

Opened 7 years ago

Closed 7 years ago

#4959 closed (invalid)

Template for loop docs suggest missing tuple unpacking feature

Reported by: anonymous Owned by: adrian
Component: Template system Version:
Severity: Keywords: for template parsing tuple dictionary
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The docs suggest you can unpack tuples in templates, however, this does not work.

Docs suggesting the missing feature: http://www.djangoproject.com/documentation/templates/#for

When attempted, this is the exception thrown:

bits = token.contents.split()
if len(bits) == 5 and bits[4] != 'reversed':
   raise TemplateSyntaxError, "'for' statements with five words should end in 'reversed': %s" % token.contents

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by anonymous

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

comment:2 Changed 7 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:3 Changed 7 years ago by John Shaffer <jshaffer2112@…>

  • Resolution set to invalid
  • Status changed from reopened to closed
  • Version SVN deleted

If you're using Django 0.96, then use the 0.96 docs: http://www.djangoproject.com/documentation/0.96/templates/

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.