question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It’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:closed
  • Created 6 years ago
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
kblomqvistcommented, Sep 17, 2017

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”.

1reaction
danizencommented, Sep 12, 2017

I just tried this with the env filter and it worked for me. I wish it were in a released version - +1

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found