Just on this point, I must disagree. For instance, consider if you
have a URL named 'i_dont_exist', and the URL pattern has two
positional arguments. If I attempted to reverse() that name, but don't
supply the required arguments, then the existing error clearly
explains why no match was found - there were no arguments passed.
The proposed error message would not explain why, and would be
misleading - there is a URL pattern, but it is not applicable without
additional arguments.
The most common time I encounter this is when using {% url %} in a
template. You pass in the appropriate positional/named arguments, but
if the variables you pass in don't correspond to valid variables, you
don't want to be told that the reason it couldn't reverse the URL was
because there was no such pattern.
Cheers
Tom
I assume the url parser already "knows" this so this is mostly a
matter of raising the appropriate exception.
Bien cordialement,
Philippe
> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
>
Any regexp with alternation that is not part of a captured parameter:
url(r'^homepage/(?:apple|banana)$', 'homepage', name='bad_homepage')
url(r'^homepage/a|b$', 'homepage', name='bad_homepage2')
Cheers
Tom