durusmail: quixote-users: Confusion about widget value
Confusion about widget value
2005-01-08
Confusion about widget value
Skip Montanaro
2005-01-08
I have a form(1) widget:

    widgets['venue'] = StringWidget('venue', value='', size=18)

which is giving me fits when I evaluate it:

    template.set_venue(widgets['venue'].parse(request))

because although I explicitly set the value to the empty string in my
constructor, the value is set to None by Widget.Parse.  (This logic seems to
hold in form(2) as well, so converting doesn't look like it will help.)
What's the logic behind that sort of move?  Can I thwart it in a reasonable
way or do I have to always extract values like so:

    widgets['venue'].parse(request) or ""

?

Thanks,

--
Skip Montanaro
skip@mojam.com
http://www.mojam.com/

reply