librelist archives

« back to archive

WTForms Optional

WTForms Optional

From:
Gyorgy Szilagyi
Date:
2011-10-06 @ 15:38
Hello,

Could you please help me?

How can I do in WTForms that, if the optional field is empty, it
wouldn't write to blank string to the database?

Thanks, Gl3am

Re: [flask] WTForms Optional

From:
Thadeus Burgess
Date:
2011-10-07 @ 06:00
pass default=None as an argument when instantiating the field

--
Thadeus




On Thu, Oct 6, 2011 at 10:38 AM, Gyorgy Szilagyi <
gyorgy.szilagyi@glas-space.com> wrote:

> Hello,
>
> Could you please help me?
>
> How can I do in WTForms that, if the optional field is empty, it
> wouldn't write to blank string to the database?
>
> Thanks, Gl3am
>

Re: [flask] WTForms Optional

From:
Gyorgy Szilagyi
Date:
2011-10-07 @ 11:29
Thank you very much,

> pass default=None as an argument when instantiating the field
> 
> --
> Thadeus