Fix #356 with the new template

Created a custom template_filter as in python3, the groupby filter cannot order Bool vs Str. Needed to push format before the groupby which is not currently possible in jinja.
This commit is contained in:
redref
2017-02-05 21:27:50 +01:00
parent 40511c007a
commit 484727b62c
3 changed files with 12 additions and 6 deletions

View File

@@ -78,6 +78,12 @@ def version():
return __version__
@app.template_filter()
def format_attribute(obj, attr, format_str):
setattr(obj, attr, format_str.format(getattr(obj, attr)))
return obj
def stream_template(template_name, **context):
app.update_template_context(context)
t = app.jinja_env.get_template(template_name)