#9915: Docs for "Naming URL patterns"
---------------------------+------------------------------------------------
 Reporter:  rmichael       |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 In the short section "Naming URL patterns",
 [http://docs.djangoproject.com/en/dev/topics/http/urls/#id2 here], the
 example is re-written as

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

 Assuming I've understood correctly, I think it would be clearer if the
 second url() call also explicitly used the "name=" parameter, and also
 provided the extra dictionary of options as the final argument (for
 consistency with the earlier discussion on the same page).  E.g.

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

 (In fact, I'm not sure it's correct if written without the named parameter
 "name", e.g. without "name=...".)

 If it's fine, and I have misunderstood, it would be nice if the
 documentation mentioned a short-hand is being used in the second url()
 call to eliminate my misunderstanding. :)

 Excellent docs in general, thanks!

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9915>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to