Builtin Filters
See original GitHub issueIt’d be helpful if there were some builtin filters that were common. For instance, here is my extension file:
import os
def filter_env(value, default=None):
return os.environ.get(value, default)
For use in a template like:
--
components:
sqlalchemy:
url: {{ 'POSTGRES_URL' | env }}
Would you consider adding this functionality?
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
14. List of Builtin Filters — Jinja2 API - GitHub Pages
Filters a sequence of objects by applying a test to an attribute of an object or the attribute and rejecting the ones with...
Read more >Template Designer Documentation - Jinja
The List of Builtin Filters below describes all the builtin filters. Tests¶. Beside filters, there are also so-called “tests” available. Tests can be...
Read more >Built-in template tags and filters - Django documentation
This document describes Django's built-in template tags and filters. ... This is equivalent to manually applying the escape filter to each variable.
Read more >Built-in Filters - Leanplum Documentation
Here are the filters available by default in Leanplum messaging: abs Return the absolute value of the argument. add Adds a number to...
Read more >Processing an Image Using Built-in Filters - Apple Developer
You can add effects to images by applying Core Image filters to CIImage objects. Figure 1 shows three filters chained together to achieve...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems like they are defined by using similar convention, https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/filter/core.py#L463, so those could be just loaded “via import”.
I just tried this with the env filter and it worked for me. I wish it were in a released version - +1