Hey list,

I've had this weird experience where I was forgetting that empty
strings were a valid value for the database, but it also means no
value in web forms. I had a situation where ``lambda x: not x or
some_validation(x)`` validation didn't fire the check for existence of
the empty string in the database column with UNIQUE constraint and
allowing NULL.

I ended up doing something like: ``value = form.field.value or None``
for all optional fields.

How would you people handle this case?


Regards,

-- 
Branko Vukelić

[email protected]
[email protected]

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to