Can someone help me with this error. No ReverseMatch

2013-04-09 Thread frocco
NoReverseMatch: Reverse for 'narrow_category' with arguments '(9L, u'pro 
contact', u'', u'', u'')' and keyword arguments '{}' not found.


url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$', 
'catalog.views.narrow_category', name="narrow_category"),

url(r'^narrow_category/(\d+)/(\w+)/$', 'catalog.views.narrow_category', 
name="narrow_category_by_text"),

url(r'^narrow_category/(\d+)/(\d+)/(\d+)/(\d+)/$', 
'catalog.views.narrow_category', name="narrow_category2"),

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




Re: Can someone help me with this error. No ReverseMatch

2013-04-10 Thread Chris Ramón

using one url would be:
url(r'''^narrow_category/(?P\d+)/(?P\w*)'''
r'(?:\/(?P\d+))?'
r'(?:\/(?P\d+))?'
r'(?:\/(?P\d+))?$',
'catalog.views.narrow_category', name="narrow_category"), 

second_digit, third_digit and fourth_digit parameters would be optional, 
and your view would look something like this:

def narrow_category(request, first_digit, words, second_digit, third_digit, 
fourth_digit):
ctx = {'first_digit': first_digit, 
'words': words, 
'second_digit': second_digit,
'third_digit': third_digit,
'fourth_digit': fourth_digit}
return render_to_response('narrow_category.html', ctx)


On Tuesday, April 9, 2013 9:28:59 AM UTC-5, frocco wrote:
>
> NoReverseMatch: Reverse for 'narrow_category' with arguments '(9L, u'pro 
> contact', u'', u'', u'')' and keyword arguments '{}' not found.
>
>
> url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$', 
> 'catalog.views.narrow_category', name="narrow_category"),
>
> url(r'^narrow_category/(\d+)/(\w+)/$', 'catalog.views.narrow_category', 
> name="narrow_category_by_text"),
>
> url(r'^narrow_category/(\d+)/(\d+)/(\d+)/(\d+)/$', 
> 'catalog.views.narrow_category', name="narrow_category2"),
>
>

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