RestOC.Templates module¶
Templates Module
Holds methods for handling templates
-
RestOC.Templates.
generate
(tpl, data={}, locale='en_US', pdf=False)¶ Generate
Generate content from a template and return it. Please note, when generating PDFs, wkhtmltopdf must be be installed on your system
- Parameters
tpl (str) – The template to load
data (dict) – The keys/values to use in the template
locale (str) – The language to use, i.e. which folder to get the template from
pdf (bool) – Set to True to return a PDF of the generated template
- Returns
str
-
RestOC.Templates.
init
(folder)¶ Init
Initialise the Templates module
- Parameters
folder (str) – The folder to find templates in
- Returns
None