Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10886 closed (fixed)

"Reversing Admin URLs" section provides invalid examples

Reported by: Simon Meers <DrMeers@…> Owned by: jacob
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

urlresolvers.reverse('admin_polls_choice_change', (c.id,))

should be:

urlresolvers.reverse('admin_polls_choice_change', args=[c.id,])

otherwise (c.id,) is interpreted as the urlconf argument, and an error such as:

AttributeError: 'int' object has no attribute 'regex'

is raised, since (c.id,) is not a urlconf. The second example with custom_admin_... should also be changed.

Attachments (1)

reverse.patch (752 bytes) - added by dc 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by Alex

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 5 years ago by dc

comment:2 Changed 5 years ago by gsong

  • Has patch set

comment:3 Changed 5 years ago by adurdin

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 5 years ago by jacob

  • Owner changed from nobody to jacob
  • Status changed from new to assigned

comment:5 Changed 5 years ago by Alex

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in r10776.

comment:6 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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.