Re: Towards a more friendly NoReverseMatch

2011-10-20 Thread Tom Evans
On Wed, Oct 19, 2011 at 7:20 PM, Wilfred Hughes wrote: > 1. Can we provide an example of a pattern containing "|" that doesn't > work? I've successfully reversed the pattern r'^fruit/(bananas|apples) > $' above. Any regexp with alternation that is not part of a captured parameter: url(r'^homepag

Re: Towards a more friendly NoReverseMatch

2011-10-19 Thread Wilfred Hughes
I've opened a ticket for improving the NoReverseMatch error: https://code.djangoproject.com/ticket/17076 However, I'd still like to improve the documentation regarding which patterns can be reversed. I don't fully understand the limitations myself yet. 1. Can we provide an example of a pattern co

Re: Towards a more friendly NoReverseMatch

2011-10-13 Thread Philippe Raoult
+1 on this, been bitten repeatedly. I assume the url parser already "knows" this so this is mostly a matter of raising the appropriate exception. Bien cordialement, Philippe On 12 October 2011 17:13, Wilfred Hughes wrote: >> >    >>> reverse('i_dont_exist') >> >    NoReverseMatch: Reverse for

Re: Towards a more friendly NoReverseMatch

2011-10-12 Thread Wilfred Hughes
> >    >>> reverse('i_dont_exist') > >    NoReverseMatch: Reverse for 'i_dont_exist' with arguments '()' and > > keyword arguments '{}' not found. > > > In this case, it would be nicer to have something like: > > >    NoURLPattern: No patterns specified for 'i_dont_exist'. > > Just on this point, I

Re: Towards a more friendly NoReverseMatch

2011-10-12 Thread Tom Evans
On Wed, Oct 12, 2011 at 12:56 PM, Wilfred Hughes wrote: > It would be really good if we could improve the errors provided when > Django can't do reverse(). > > For example: > >    >>> reverse('i_dont_exist') >    NoReverseMatch: Reverse for 'i_dont_exist' with arguments '()' and > keyword argument