Setting null=True in the field definition and doing model.field = None
doesn't do this?

If you create a gist or a paste with a sample code would help understand
better.


On Thu, Nov 7, 2013 at 8:37 AM, Vlastimil Zíma <[email protected]> wrote:

> Hi everybody,
>
> I know this was here before, but it is really a problem. We need (I
> literally mean need, not just want) a simple way to store NULL in database
> instead of ''. Using empty string has several serious consequences (in
> databases which distinguishes between NULL and '', which are to my
> knowledge all but oracle).
>
>  * You can't make a model with unique optional field. Django admin will
> let you store only one object without the value, because others with
> conflict the unique constraint.
>  * It is useless to set NOT NULL constraints on text fields. Because
> Django stores empty string as empty value, database will not complain about
> invalid data and just stores the rubbish.
>
> I don't want to enforce anybody to use only NULL as empty value, I just
> want Django to store NULL in database when I told it to. And I don't mean
> the way of overriding all the form fields as I have to now.
>
> Regards,
> Vlastimil
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/f6641177-63a2-4adc-8166-503305c8e6b7%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Elyézer Rezende
http://elyezer.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFsoaZvxLhUC59iLZVVxhWoWRw3k-SHJXYA_PiAA_H%3Drn-Keng%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to