On Mon, 2007-07-09 at 15:20 -0700, xgdlm wrote:
> Hello all,
> 
> I just sync my django with the latest SVN version to try the Unicode
> branch. Previously I was running Django 0.96pre.
> I have now an issue with reverse url.
> 
> Here is for exemple my urls.py
> 
> urlpatterns = patterns('',
>       (r'member/status(?P<status>\d+)/(?P<page>\d+)/$',
> 'app.views_admin.member_list'),
>       (r'member/status(?P<status>\d+)/$', 'app.views_admin.member_list'),
>         (r'member/$', 'app.views_admin.member_list'),
> )
> 
> I used to retrieve the reverse URL by calling :
> 
> reverse('app.views_admin.member_list',urlconf=None,args=[3,2]) and
> this was returning /member/status3/2/
> reverse('app.views_admin.member_list',urlconf=None,args=[3]) and this
> was returning /member/status3/
> reverse('app.views_admin.member_list',urlconf=None,args=[]) and this
> was returning /member/
> 
> It seems not working anymore, I get the error message 'NoReverseMatch:
> Not enough positional arguments passed in' .
> 
> I used to decalre my URL linked to the same view in number of
> arguments descending ... so if one arg was given the first (r'member/
> status(?P<status>\d+)/(?P<page>\d+)/$', 'app.views_admin.member_list')
> didn't match then the (r'member/status(?P<status>\d+)/$',
> 'app.views_admin.member_list') mached. If no argument was given the
> first two URL pattern didn't match so the last one matched. This is
> not the case with the latest SVN version
> 
> I guess this is a side effect of the named URL patterns feature ....

Firstly: don't guess... test! Assumption is the mother of all, well, bad
things. Between 0.96pre and now there have been about 1000 subversion
commits, including probably a dozen or so to urlresolvers.py alone. It
could be anything.

It might be, for example, that the order in which comparisons are done
has changed. I don't know. I'll have to test things out.

The problem is that reverse matching against ambiguous view names has at
least one known bug: it only checks one of the entries with a particular
name instead of all of them. I have a hunch this stopped working
reliably before we introduced reverse matching, but I may be wrong and
it really isn't important, since it's just a bug.

Could you open a ticket giving the urlpatterns in this message and the
examples, please. That way we won't lose track of it (I have a feeling
there is already an open ticket for the problem I mention in the above
paragraph, but I cannot find it when I searched just now; maybe you'll
have more luck).

Regards,
Malcolm


-- 
Experience is something you don't get until just after you need it. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to