django - NoReverseMatch Reverse for '' with arguments '()' and keyword arguments '' not found -


i have in django view:

edit_url = reverse('ventas:clientes_edit',kwargs={'id':str(self.object.id)})

and in urls.py:

url(r'^clientes/edit/(?p<pk>\d+)$',forms.clienteupdateview.as_view(), name="clientes_edit"),

when create new customer via ajax need return reverse url id in json data put in series of actions buttons edit, delete... error , don't know how accomplish it, complete error:

noreversematch @ /ventas/clientes/add/ reverse 'clientes_edit' arguments '()' , keyword arguments '{'id': '38'}' not found.

any ideas?

edit:

the django version 1.5

the kwargs should pass pk not id match url

edit_url = reverse('ventas:clientes_edit',kwargs={'pk':self.object.id}) 

also url expects int pk not string.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -