What does your PartialCourseForm class look like? The code you have
there looks okay to me.



On Nov 7, 3:21 pm, Torbjorn <torbjorn.lundqu...@googlemail.com> wrote:
> Hi, I want to update a record but somehow it becomes an INSERT
> instead. This is my code:
>
> def editcourse(request, course_id):
>     course= Course.objects.get(id=course_id)
>     if request.method == 'POST':
>         form = PartialCourseForm(request.POST, instance=course)
>         if form.is_valid():
>             form.save()
>             return HttpResponseRedirect("/courses/")
>     else:
>         form = PartialCourseForm(instance=course)
>
>     return render_to_response("editcourse.html", {'form':form})
>
> What do I wrong?
> Thanks
> /Torbjörn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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