Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16024 closed Bug (invalid)

documentation problem, not sure

Reported by: nicolaetitus12@… Owned by: elbarto
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

here

http://docs.djangoproject.com/en/1.3/topics/http/urls/#naming-url-patterns

urlpatterns = patterns('',
    url(r'^archive/(\d{4})/$', archive, name="full-archive"),
    url(r'^archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"),
)

should be

urlpatterns = patterns('',
    url(r'^archive/(\d{4})/$', archive, name="full-archive"),
    url(r'^archive-summary/(\d{4})/$', archive, {'summary': True}, name="arch-summary"),
)

it's missing the name= label

Attachments (1)

patch.diff (588 bytes ) - added by elbarto 13 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Jonas H., 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by elbarto, 13 years ago

Owner: changed from nobody to elbarto

by elbarto, 13 years ago

Attachment: patch.diff added

comment:3 by elbarto, 13 years ago

Has patch: set

comment:4 by Julien Phalip, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Julien Phalip, 13 years ago

Type: UncategorizedBug

comment:6 by Tim Graham, 13 years ago

Resolution: invalid
Status: newclosed

The example is correct as is. The first url doesn't have any kwargs like the second does, so the name= prefix is required there.

comment:7 by Jonas H., 13 years ago

I'd like to see this change anyway -- for the sake of consitency.

comment:8 by Julien Phalip, 13 years ago

The example is correct, but I think it is good practice to systematically use the explicit "name=" argument as kwargs aren't always provided to url() and it's easy to make mistakes. Not a big deal though.

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