From e4a60cf7b100eb084ce31a4216b9de0e77c7c54b Mon Sep 17 00:00:00 2001 From: Alexey Date: Sun, 29 Mar 2020 14:53:29 +0300 Subject: [PATCH] Add `reject` filter docs --- docs/templating.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/templating.md b/docs/templating.md index 9f4698ec..ee27d2d3 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -1389,6 +1389,32 @@ Select a random value from an array. A random value between 1-9 (inclusive). +### reject + +Filters a sequence of objects by applying a test to each object, and rejecting +the objects with the test succeeding. + +If no test is specified, each object will be evaluated as a boolean. + +**Input** + +```jinja +{% set numbers=[0, 1, 2, 3, 4, 5] %} + +{{ numbers | reject("odd") | join }} +{{ numbers | reject("even") | join }} +{{ numbers | reject("divisibleby", 3) | join }} +{{ numbers | reject() | join }} +``` + +**Output** + +```jinja +024 +135 +1245 +0 +``` ### rejectattr (only the single-argument form)