We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The finalize function seems to be executed on the whole template, not only on variables.
E.g. a function like def fin(s): print s; return s dumps the whole template file.
The text was updated successfully, but these errors were encountered:
Any input on this, we're running into the same thing?
We like to look at the variable expressions and modify them based on different criteria but returning the entire template makes this impossible.
Sorry, something went wrong.
I'm seeing this too. It seems like finalize should run only on expressions evaluated during render, but it runs when the template is constructed also.
is this fixed? i still see it in the latest version (2.8).
rom jinja2 import Environment, Template context = {'k': 'v'} template = """ abc {{ k }} def """ def fin(data): return 'replaced' env = Environment(finalize=fin) tpl = env.from_string(template, template_class=Template) print tpl.render(**context)
It displayed 'replacedreplacedreplaced', we want this to be fixed as we need this feature very explicitly
Successfully merging a pull request may close this issue.
The finalize function seems to be executed on the whole template, not only on variables.
E.g. a function like
def fin(s): print s; return s
dumps the whole template file.
The text was updated successfully, but these errors were encountered: