[Zope] Using Template in script (python)

Miguel Beltran R. yourpadre at gmail.com
Wed Apr 8 23:19:04 CEST 2015


Hi list,
I'm trying to use the make a  string using a Template and fill it with the
result of a query, but gime this error
You are not allowed to access 'safe_substitute' in this context

Zope = 2.12

from string import Template
rst=someSQL()[0]
txt=Template("""
<span id="datos_vehiculo"
   data-placa="${placa}"
   data-serie="${serie}"
   data-marca="${marca}"
   data-submarca="${submarca}"
   data-modelo="${modelo}">
</span>
""")
newtxt=txt.safe_substitute(rst)

do exist some way to do it?
-- 
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zope/attachments/20150408/d7e00dd3/attachment.html>


More information about the Zope mailing list