I changed it to save(), but it still doesn't save. I did a test by changing
the title of the todos, and it is saving changes... the problem is in
finding out which boxes are checked.
I'll look into form_for_model and form_for_instance.

On 6/23/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
>
>
> Nathaniel:
>
>
> On Jun 22, 3:42 pm, "Nathaniel Martin" < [EMAIL PROTECTED]> wrote:
> > I'm working on learning Django, and I'm having trouble getting a basic
> > "todo" app working.
> >
> > I'm listing all my todo items in my template, with a checkbox next to
> each
> > one for "done".
> >
> > I have an update button that goes to a view that updates all the item's
> done
> > values.
> >
> > But, it's not working. It doesn't store my updates. I can edit it
> through
> > the admin without problems, but I  can't get it to work with my code.
>
>
>
> >
> > def update(request):
> >   checked = request.POST.getlist('doneArray')
> >   for item in TodoItem.objects.all ():
> >     try:
> >       checked.index(item.id)
> >       item.Done=True
> >     except:
> >       item.Done=False
> >     item.save           <-----------------------------
> -----------------------
> >   return HttpResponseRedirect('/list/')                              |
> >
>                          |
>
> |
> I haven't tested your code.  But I think you should write item.save()
> instead of item.save.  Maybe that's why it is not saving your data.
> Anyway,  I would try to use form_for_model and form_for_instance to
> automatically create a "widgetized" form, instead of trying to build
> it "by hand".
>
> RobertoZ
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to