diff --git a/CHANGES.rst b/CHANGES.rst index 37e777dc..63271214 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,7 @@ Unreleased - Drop support for Python 3.9. :pr:`5730` - Remove previously deprecated code: ``__version__``. :pr:`5648` +- Support for using @app.template_filter, @app.template_test, and @app.template_global decorators without parentheses. :pr:`5736` Version 3.1.1 diff --git a/docs/templating.rst b/docs/templating.rst index 23cfee4c..e5cb955a 100644 --- a/docs/templating.rst +++ b/docs/templating.rst @@ -145,7 +145,11 @@ that. You can either put them by hand into the :attr:`~flask.Flask.jinja_env` of the application or use the :meth:`~flask.Flask.template_filter` decorator. -The two following examples work the same and both reverse an object:: +The following examples work the same and all reverse an object:: + + @app.template_filter # use the function name as filter name + def reverse_filter(s): + return s[::-1] @app.template_filter('reverse') def reverse_filter(s):