"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:
|
no
|
UI/UX:
|
no
|
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.
Fixed in r10776.