Right way to set a variable to NULL?

Martin martin at marcher.name
Fri Dec 26 19:05:16 EST 2008


2008/12/26 John Machin <sjmachin at lexicon.net>:
> The above all have the same characteristic: if the input is a zero-
> length string, then NULL is inserted into the database instead of a
> zero-length string. Some folks (not just pedants!) regard that as an
> important difference.

agreed but I understood the OP specifically wanted NULL and not ''.

of course for data gathering in web apps I'd personally make the mail
attribute a NOT NULL and reject anybody who wouldn't give me their
mail address. After all mail is the way to get in touch with my
customers/user if they register on my site, and if it's only for a
password reset link.

/martin


-- 
http://soup.alt.delete.co.at
http://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



More information about the Python-list mailing list