#16024 closed Bug (invalid)
documentation problem, not sure
Reported by: | 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)
Change History (9)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Owner: | changed from | to
---|
by , 14 years ago
Attachment: | patch.diff added |
---|
comment:3 by , 14 years ago
Has patch: | set |
---|
comment:4 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:5 by , 14 years ago
Type: | Uncategorized → Bug |
---|
comment:6 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:8 by , 14 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.
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.