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':
        form = ActionForm(request.POST)

    #....

   return render_to_response('tmp.html', locals())#etc...

On Mar 18, 3:11 pm, Benedict Verheyen <benedict.verhe...@gmail.com>
wrote:
> 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=False would mean i need to specify the
> fields in the ModelForm and i would like to avoid that if possible.
>
> Also, the documentation says that specifying an instance should take
> care of filling in the missing values:
>
> ========quote=======
>
> Note
>
> If you specify fields or exclude when creating a form with ModelForm,
> then the fields that are not in the resulting form will not be set by
> the form's save() method. Django will prevent any attempt to save an
> incomplete model, so if the model does not allow the missing fields
> to be empty, and does not provide a default value for the missing
> fields, any attempt to save() a ModelForm with missing fields will
> fail. To avoid this failure, you must instantiate your model with
> initial values for the missing, but required fields:
>
> author = Author(title='Mr')
> form = PartialAuthorForm(request.POST, instance=author)
> form.save()
> ========quote=======
>
> So why do i get the IntegrityError complaining about null values?
>
> Regards,
> Benedict

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