flask.Flask.template_filter

Flask.template_filter(*args, **kwargs)[source]

A decorator that is used to register custom template filter. You can specify a name for the filter, otherwise the function name will be used. Example:

@app.template_filter()
def reverse(s):
    return s[::-1]
Parameters:name – the optional name of the filter, otherwise the function name will be used.