Opened 6 years ago

Closed 6 years ago

Last modified 6 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:

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 6 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by Jonas H.

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by elbarto

Owner: changed from nobody to elbarto

Changed 6 years ago by elbarto

Attachment: patch.diff added

comment:3 Changed 6 years ago by elbarto

Has patch: set

comment:4 Changed 6 years ago by Julien Phalip

Triage Stage: AcceptedReady for checkin

comment:5 Changed 6 years ago by Julien Phalip

Type: UncategorizedBug

comment:6 Changed 6 years ago by Tim Graham

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 Changed 6 years ago by Jonas H.

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

comment:8 Changed 6 years ago by Julien Phalip

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