Opened 4 years ago

Closed 4 years ago

Last modified 4 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 4 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 4 years ago by jonash

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

comment:2 Changed 4 years ago by elbarto

  • Owner changed from nobody to elbarto

Changed 4 years ago by elbarto

comment:3 Changed 4 years ago by elbarto

  • Has patch set

comment:4 Changed 4 years ago by julien

  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 4 years ago by julien

  • Type changed from Uncategorized to Bug

comment:6 Changed 4 years ago by timo

  • Resolution set to invalid
  • Status changed from new to closed

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 4 years ago by jonash

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

comment:8 Changed 4 years ago by julien

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