Re: error when updating

2010-03-19 Thread Benedict Verheyen
Benedict Verheyen wrote: > Benedict Verheyen wrote: > > As expected, it works if i set the values in my view: > > action = get_object_or_404(Action, pk=action_id) > form=ActionForm(instance=action) > if request.method == 'POST': > form = ActionForm(request.POST, action) > if form.is_valid

Re: error when updating

2010-03-19 Thread Benedict Verheyen
Benedict Verheyen wrote: > > This is the code in my update view: > > def action_edit(request, action_id): > action = get_object_or_404(Action, pk=action_id) > if request.method == 'POST': > form = ActionForm(request.POST, action) > if form.is_valid(): > form.sa

Re: error when updating

2010-03-18 Thread Benedict Verheyen
ge...@aquarianhouse.com wrote: > You Welcome. > > I guess is the combination between POST nad instance data. > > did you try only: > > form = ActionForm(request.POST) > > because in POST is already the data posted. > > you might have like this before the form: > > def view_name(request): >

Re: error when updating

2010-03-18 Thread ge...@aquarianhouse.com
You Welcome. I guess is the combination between POST nad instance data. did you try only: form = ActionForm(request.POST) because in POST is already the data posted. you might have like this before the form: def view_name(request): form = ActionForm() if request.method == 'POST':

Re: error when updating

2010-03-18 Thread Benedict Verheyen
ge...@aquarianhouse.com wrote: > Hi, > > I hope I understood it right. You could set the field to > editable=False, the rest Django will take care. > > Btw, you have a typo "attachement" should be "attachment" I think. > Thanks for the info & finding the typo. Setting the field to editable=Fals

Re: error when updating

2010-03-18 Thread ge...@aquarianhouse.com
Hi, I hope I understood it right. You could set the field to editable=False, the rest Django will take care. Btw, you have a typo "attachement" should be "attachment" I think. On Mar 18, 2:47 pm, Benedict Verheyen wrote: > Hi, > > i have a problem when saving a form for updating. > In my model,

error when updating

2010-03-18 Thread Benedict Verheyen
Hi, i have a problem when saving a form for updating. In my model, i have a field date_created. Now when i edit the form, i don't want that field to be editable and thus is don't include it in the field list. I have specified a form where i specify the fields that i want to see on the form. I h