Merge pull request #402 from 42sol-eu/master

Add documentation for get_undeclared_template_variables() method
This commit is contained in:
Eric Lapouyade 2021-12-30 12:07:43 +01:00 committed by GitHub
commit 19733a6b5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,17 @@ Use instead::
{{ myvariable }} {{ myvariable }}
{% if something %} {% if something %}
Get Defined Variables
+++++++++++++++++++++
In order to get the missing variables after rendering use ::
tpl=DocxTemplate('your_template.docx')
tpl.render(context_dict)
set_of_variables = tpl.get_undeclared_template_variables()
**IMPORTANT** : You may use the method before rendering to get a set of keys you need, e.g. to be prompted to a user or written in a file for manual processing.
Extensions Extensions
++++++++++ ++++++++++