librelist archives

« back to archive

Decorator for template globals

Decorator for template globals

From:
Dan Jacob
Date:
2010-05-05 @ 10:38
A decorator for adding a function to template globals would help hide
some internals:

@app.template_global
def do_something():
    return "OK"

This would be the equivalent of app.jinja_env.globals['do_something']
= do_something