On 10/23/07, Alberto Valverde <[EMAIL PROTECTED]> wrote:
>
>
> Until I can log on to the wiki I've posted the tutorial at my blog:
> http://albertovalverde.es/twforms_tutorial1.html
Cool. I don't have time to read it thouroughly but I certainly will.
One remark I noticed:
"""We're importing the validators from the twForms' validators module. This
module includes all validators from FormEncode but overrides
UnicodeStringso it doesn't encode strings when converting from python.
This is needed
because Genshi and Mako need all strings to be unicode internally (or at
least be ascii encodable). """
I remember this issue back when I worked on TG but now I use stock
UnicodeString validators in my Pylons and it just works.
I checked the FE source and it does the encoding now:
def _from_python(self, value, state):
if hasattr(value, '__unicode__'):
value = unicode(value)
if isinstance(value, unicode):
return value.encode(self.outputEncoding)
return str(value)
--
Max Ischenko
http://www.developers.org.ua/ -- Ukrainian software developers community
http://maxischenko.in.ua/ -- my blog (Russian)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---