Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filter to apply dynamic filters #203

Merged
merged 9 commits into from
Oct 1, 2018
Merged
10 changes: 10 additions & 0 deletions docs/builtins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,13 @@ Filter accepts several arguments:
* indentation character: character to be used for indentation. Default is a space.
* indent first line: whether first line of output should be indented or not. Default is ``false``.

``filter``
~~~~~~~~~

Applies filter by its name, provided as an argument.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applies the filter with the name (provided as argument) to the current expression.


.. code-block:: html+django

{{ string|filter:myfilter }}

This expression will resolve `myfilter` variable and will apply filter with such name to `string` variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This expression will resolve the myfilter variable, and it will apply the filter with that resolved name to the string variable.