Tuesday, 20 August 2013

NoReserveMatch error when passing multiple parameters to template

NoReserveMatch error when passing multiple parameters to template

I'm getting a NoReverseMatch error:
Reverse for 'state' with arguments '('', '')' and keyword arguments '{}'
not found.
I have 2 ids being passed to the template and that seems to be the problem.
views.py
def state(request, country_id, state_id):
countrystate = State.objects.all()
return render_to_response("template.html", {'countrystate':
countrystate})
urls.py
url(r'^my_index/(?P<country_id>\d+)/state/(?P<state_id>\d+)/$',
'my_App.views.state', name='state'),
template.html
<form class="option_form" action="{% url "state" country.id state.id %}"
method="post">
any ideas?

No comments:

Post a Comment