Two other things about auto-escaping.

The Pyramid and Mako default is to convert ``None`` to ``u'None'``.
The Pylons default (i.e., Pylons' Mako configuration) is to convert
``None`` to ``u''``. To get the None-to-"" conversion, you have to
replace the default filter with ``markupsafe.escape_silent``.  I don't
remember exactly where you do this in Pyramid apps.

The other thing is, a non-string object can also provide an
'.__html__' method. That way it can be used directly as a template
variable, and it can provide its preferred HTML rendering. It can
return an ordinary string; it doesn't have to mark it.  (Marking it
would cause an infinite recursion. :) The implementations of
Markup/literal themselves return 'self' when '.__html__' is called.

-- 
Mike Orr <[email protected]>

-- 
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.

Reply via email to