Check for variables used in document in Python prior to rendering

Hi all,

I hope you had a good start into the new year!

I have a question regarding relatorio and python:
I often find it difficult to identify the real reason for the rendering of a template failing.

Is it possible to check for all used variables that a template references in python prior to rendering the template as odt?

I would then perform a check to see if all referenced variables are available in the data object that I pass to relatorio.

Also, is it possible to set relatorio to skip any section that references variables that are not present?

Thanks
DomCa

Normally you get the expression (with some caching extra function) that is failing and usually it is easy to find it in your template.

I do not think so because it support the full Python language.

What do you mean by “skip section”?

Hi Ced,

That’s probably right. I am not sure, what I would be looking for here. Maybe something like a hint to a page/line in the template document.

With “skip” I mean that the template could finish rendering instead of failing with an error. Maybe that section could then print “Error” or something, but still finish rendering.

This should of course only be an option/flag, since people may not want to render long templates without failing, if there are errors.

Regards,
DomCa

1 Like