use template_filter without parens

This commit is contained in:
kadai0308 2025-05-17 12:17:18 +08:00 committed by David Lord
parent 85c5d93cbd
commit daf1510a4b
No known key found for this signature in database
GPG key ID: 43368A7AA8CC5926
6 changed files with 272 additions and 23 deletions

View file

@ -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):