On Monday 27 Jul 2009 4:55:42 pm Malcolm Tredinnick wrote:
> > url(r'^addlandmark/((?P<id>\d+)/)?$', 'addlandmark',
> > name='add_landmark'),
>
> You have nested capturing groups here, which is almost always an error.
> You have also mixed positional and named arguments, for bonus confusion
> (if they weren't nested, it would be a bug). In any case, URL reversing
> can't handle anything except the outermost capturing groups in a
> reg-exp.
>
> I suspect you intend your pattern to be
>
>         r'^addlandmark/(?:(?P<id>\d+)/)?$'
>        
> changing the optional portion to be a non-capturing group. Then your
> pattern only takes (and captures) a single keyword argument parameter:
> id.

yes, I suppose so. I am now working around having two patterns - one for no id 
and the other with id.
-- 
regards
kg
http://lawgon.livejournal.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to