pyramid.scaffolds
¶
- class Template(name)[source]¶
Inherit from this base class and override methods to use the Pyramid scaffolding system.
- render_template(content, vars, filename=None)[source]¶
Return a bytestring representing a templated file based on the input (content) and the variable names defined (vars).
filename
is used for exception reporting.
- template_dir()[source]¶
Return the template directory of the scaffold. By default, it returns the value of
os.path.join(self.module_dir(), self._template_dir)
(self.module_dir()
returns the module in which your subclass has been defined). Ifself._template_dir
is a tuple this method just returns the value instead of trying to construct a path. If _template_dir is a tuple, it should be a 2-element tuple:(package_name, package_relative_path)
.
- class PyramidTemplate(name)[source]¶
A class that can be used as a base class for Pyramid scaffolding templates.