I assume that MatterUpdateView is a subclass of the generic UpdateView
class. If so, that class expects an object pk (id) or slug to be
included as part of the URL pattern, and yours doesn't include either.
Your URL pattern should look something more like:
r"^manage/(?P<pk>\d+)/update/"

_Nik

On 6/6/2013 10:16 PM, Ariel V. R. wrote:
> Code:
>
> HTML
> <form id="form-edit" action="/manage_p1/update/" method="get"  >
>       <input  id="input-pk" type="hidden" value="0" name="pk">       
>                
> </form>
>
> JS
> $('.icon-edit').click( function() {
>         $object_id = $(this).parents().eq(0).attr('id');
>         $('#form-edit #input-pk').attr('value', $object_id);
>         $('#form-edit').submit();
>     })
>
> URL.PY
>
> ...
> url(r'^manage_p1/update/', MatterUpdateView.as_view()), 
> ...
>
>
>
> El jueves, 6 de junio de 2013 23:45:59 UTC-5, Ariel V. R. escribió:
>
>     Hello:
>
>     I need to send data from html using javascript to UpdateView.
>     Django sends me an error:  "Generic detail view MatterUpdateView
>     must be called with either an object pk or a slug."
>
>     I think that the problem exists because the method as_view() does
>     not receive the correct data.
>
> -- 
> 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.
>  
>  

-- 
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.


Reply via email to