You could override your ModelForm's save() method to save some data to that
field. And then modify the same ModelForm to exclude that field. For
example,

class MyForm(ModelForm):
    class Meta:
        exclude = ('excluded_field',)

That way it won't expect any data for the field when processing the form
and in your save() method you can just choose whatever you like to save
there.

If you still need some more help, feel free to throw up some example code
and I'm sure someone will be able to help more.

Good luck!

On Wed, Jul 18, 2012 at 9:33 AM, Javier Guerra Giraldez
<jav...@guerrag.com>wrote:

> On Wed, Jul 18, 2012 at 5:48 AM, mapapage <mapap...@gmail.com> wrote:
> > Of course, i don't wanna change the thing that it is not nullable.
>
> then what do you want to insert there?
>
> you can either define a default value, add a hidden field to the form,
> or in the view add some value to the user input before feeding to the
> form object
>
> --
> Javier
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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