Using Template in script (python)
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
I just gave out the first 3 zopache accounts! I thought Zope 2 developers would be interested in this news. Zopache is a browser-based Javascript development environment. These accounts support Basic Web Objects: Folder, HTML, Javascript, CSS, and image. HTML objects support the WYSIWYG ckEditor. HTML, CSS and Javascript objects support the syntax-checking ACE Editor. There is also a development version of the Jade http://jade-lang.com/ <http://jade-lang.com/> editor. Regards Chris
http://www.zopache.com/zopache/baseicwebobjects/jade <http://www.zopache.com/zopache/baseicwebobjects/jade> Specifically Zopache has a gorgeous Jade editor, and real time html and javascript generation. “Instant Gratification!” says one user. Jade is the leading tempting language for Javascript. http://jade-lang.com/ <http://jade-lang.com/> Jade is a terse tempting language, much like python. No end tags required. Jade can generate HTML, or Javascript. Jade has two great strengths. It is particularly good at managing json data. And it allows for mixins. One can assemble pages from many jade fragments. With Zopache, you can acquire the mixin. My use case is resume trees. Have one basic resume template, and then subfolders can each customize the introductory paragraph, one for each industry. Maybe even one for each job. Chris
participants (2)
-
Christopher Lozinski -
Miguel Beltran R.