Thanks to point me to filter_in, filter_out functions they are helpful 
indeed.

The problem is that not all the view data comes from a database, form.vars 
for example or any custom variable from a controller or a model. Wrapping 
everything in all the views is not mantainable. 

All this data, shares something in common that is, they are passed to the 
template engine to render the view. 

Theres some code ive found on this post 
<https://groups.google.com/forum/#!topic/web2py/ZnPL-FyDd_U> we can tamper 
with, about how the view renders data.

gluon/template.py | line 867
~~~~~
    # Here to avoid circular Imports
    try:
        from globals import Response
    except:
        import cStringIO
        from xml.sax.saxutils import escape, quoteattr
        class Response():
            def __init__(self):
                self.body = cStringIO.StringIO()
            def write(self, data, escape=True):
                if not escape:
                    self.body.write(str(data))
                elif hasattr(data,'xml') and callable(data.xml):
                    self.body.write(data.xml())
                else:
                    # otherwise, make it a string
                    if not isinstance(data, (str, unicode)):
                        data = str(data)
                    elif isinstance(data, unicode):
                        data = data.encode('utf8', 'xmlcharrefreplace')
                    self.body.write(data)

Is there any place we can find specifications of web2py's template engine?

Thanks.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to