Rendering ZPT macros from python code made easy
Project description
Introduction
This package renders macros from a given page template using pure python.
Sometime you may want to use page templates like code libraries where for each functionality you have one macro. Calling macros is no problem using ZPT use-macro but how do you call macros from pure python code and also pass parameters? Because there do not seems to be an obvious solution for this problem (especially the parameters part) this package was created.
Render macro with name macroname from a given page template:
>>> from anthill.tal.macrorenderer import MacroRenderer >>> template = ViewPageTemplateFile('template.pt') >>> renderer = MacroRenderer(template, 'macroname') >>> print renderer(data={'option1' : 42})
Changelog
0.1 (2009-08-08)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for anthill.tal.macrorenderer-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb21f9893a0a33e80412a71cfcf8dafc865f195485082402f7e1bcfb91d3ea3 |
|
MD5 | d83ee5631984aa1f6c325c9bad50e464 |
|
BLAKE2b-256 | 6c39f32e77444252b59b26e041eec028213a0bff4ff76f414ba9a73bbf07bbcf |