I have a regular expression defined to capture optional parameters in a view.
url(r'^lista/((?P<tematica>[0-9]+)/(?P<pageIndex>[0-9]+)/(?P<pageSize>[0-9]+))|/$', views.PinturasListView.as_view(), name='lista')
in theory, pageIndex and pageSize are optional (the 3 parameters or none should reach the view). The problem that when I try to put the optional arguments from the template I mark error in the following line:
<a href="{% url 'pintura:lista' tematica='1' pageIndex='0' pageSize='6' %}">
however if I use it like this it works:
<a href="{% url 'pintura:lista' %}">
But I need to pass on the kwargs to do what I need. Specifically the description of the error is:
Reverse for 'lista' with arguments '()' and keyword arguments '{u'tematica': u'1', u'pageIndex': u'0', u'pageSize': u'6'}' not found. 1 pattern(s) tried: [u'pinturas/lista/((?P<tematica>[0-9]+)/(?P<pageIndex>[0-9]+)/(?P<pageSize>[0-9]+))|/$']