On Tuesday, 13 September 2011 12:40:59 UTC+1, David wrote:
>
> Hello 
>
> This is my code so far from urls.py 
>
> from django.views.generic import ListView, create_update 
>
>         url(r'^reportwriting/types/edit/(?P<object_id>\d+)/?$', 
> create_update.update_object( 
>             model=Type 
>     )), 
>
> I am trying to use the new CRUD generic views but am repeatedly 
> getting the following error: 
>
> TypeError at /reportwriting/types/edit/1/ 
> update_object() takes at least 1 argument (1 given) 
>
> I think syntactically I must be screwing up, but am not having much 
> progress using the Django docs. 
>
> Thanks for any assistance.


create_update.update_object is one of the *old* function views. They work 
the same as any other functional view: you don't *call* them in urls.py, you 
reference them and pass extra context arguments as necessary.

The new class-based CRUD views are documented here:
https://docs.djangoproject.com/en/1.3/ref/class-based-views/#editing-views
You probably want UpdateView, which like all class-based view needs to be 
referenced in urls.py as UpdateView.as_view(model=Foo)
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/wymV24iokYIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to