Opened 18 years ago

Closed 18 years ago

#3981 closed (invalid)

naming-url-patterns

Reported by: django-tix@… Owned by: Jacob
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

http://www.djangoproject.com/documentation/url_dispatch/#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"),
)

Change History (1)

comment:1 by Malcolm Tredinnick, 18 years ago

Resolution: invalid
Status: newclosed

Both forms are correct. You only have to use keyword arguments when one of the four positional arguments are missing.

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