This patch adds an "AsString" converter:

415a418,431
> class AsString(ValidatorConverter):
>     """
>
>     Converts things to string, but treats empty things as the empty
>     string. I'm quite sure it doesn't handle every degenerate case.
>
>     """
>
>     def convert(self, value):
>         if value: return str(value)
>         if value == 0: return str(value)
>         return ""
>
>

Good for things like TextField, where you may want the empty string
instead of None (then again, you may want None.)



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to