HTML genshi function in TG2 templates

2 views
Skip to first unread message

James

unread,
Dec 30, 2009, 1:40:13 PM12/30/09
to TurboGears
Hello all - is there a TG2 analog to being able to use genshi's HTML()
and XML() directly in templates?

Failing that, can I add python function's into the template context
somehow?

Cheers!

James

unread,
Dec 30, 2009, 2:51:11 PM12/30/09
to TurboGears
On IRC, mpedersen suggested the HTML and XML functions *should*
already be there - not sure they're not for me...

A good-enough workaround is to add
<?python
from genshi import HTML, XML
?>

to the root of your template hierarchy.

J

Michael Pedersen

unread,
Dec 30, 2009, 3:27:52 PM12/30/09
to turbo...@googlegroups.com
Just to follow up on this thread, the exact solution that was found (and works) is to insert the following into your genshi template:

<?python
    from genshi import HTML
?>

Once done, the HTML function is now visible and usable in your template.

--

You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.





--
Michael J. Pedersen
My IM IDs: Jabber/pede...@icelus.tzo.com, ICQ/103345809, AIM/pedermj022171
         Yahoo/pedermj2002, MSN/pederm...@hotmail.com

Reply all
Reply to author
Forward
0 new messages