On Wed, 2008-09-03 at 14:07 -0700, catsclaw wrote: > On Sep 3, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > Sorry, my crystal ball is down for maintainance - but the answer is > > probably that the django.core.urlresolvers.reverse function didn't > > found a match. The easiest way to check this out would be to test a > > direct call to the aforementioned function in the interactive shell > > using the very same parameters... > > That's all well and good, but the definition of those is: > > urlpatterns = patterns('', > (r'^myapp/(?P<my_name>.+)/list(?P<my_dir>/.*)$', > 'myapp.views.list'), > (r'^myapp/(?P<my_name>.+)/show(?P<my_file>/.*)$', > 'myapp.views.show'), > ) > > ... so I can't understand why this throws a NoReverseMatch: > > >>> import django.core.urlresolvers as ur > >>> ur.reverse("myapp.views.list", kwargs={'my_name': 'test', 'my_dir': > >>> 'text'})
Because the 'my_dir' capturing group for myapp.views.list is expecting a forwards slash as the first character of the pattern there. And you're passing something without a forwards slash, so it doesn't match. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---