This repository implements a number of additional filters for the excellent pongo2
template engine. Note that as most of these filters are inspired by Jinja2 template syntax, this module requires my
fork of pongo2 which implements several Jinja2 syntax features.
Filters List
Jinja2-compatible
abs - Returns the absolute value of the argument.
(doc)
reject - Filters a sequence of objects by applying a test to each object, and rejecting the objects with the test
succeeding.
(doc)
rejectattr - Filters a sequence of objects by applying a test to the specified attribute of each object, and
rejecting the objects with the test succeeding.
(doc)
replace - Return a copy of the value with all occurrences of a substring replaced with a new one.
(doc)
reverse - Reverse the object or return an iterator that iterates over it the other way round.
(doc)
round - Round the number to a given precision.
(doc)
select - Filters a sequence of objects by applying a test to each object, and only selecting the objects with the
test succeeding.
(doc)
selectattr - Filters a sequence of objects by applying a test to the specified attribute of each object, and only
selecting the objects with the test succeeding.
(doc)
sprintf - Like format (from the Jinja2-compatible filters list above) but the first argument is the format string
and the variable is the value to be formatted.
JSONEncoder specifies a callback to use to encode JSON values as an alternative to the (ridiculously slow) standard
library encoder. This should be set before the first template is created and not modified again.