Method-calling filter for use in Jinja's map filter.#50152
Merged
rallytime merged 3 commits intosaltstack:developfrom Oct 23, 2018
zer0def:method-call-jinja-filter
Merged
Method-calling filter for use in Jinja's map filter.#50152rallytime merged 3 commits intosaltstack:developfrom zer0def:method-call-jinja-filter
map filter.#50152rallytime merged 3 commits intosaltstack:developfrom
zer0def:method-call-jinja-filter
Conversation
Contributor
Author
|
I'm also aware that returning |
map filter.map filter.
map filter.map filter.
cachedout
approved these changes
Oct 22, 2018
Contributor
cachedout
left a comment
There was a problem hiding this comment.
This is clever. I like it.
Contributor
Author
|
Clever until someone stubs their toe on methods mutating values in-place and returning |
rallytime
suggested changes
Oct 23, 2018
Contributor
rallytime
left a comment
There was a problem hiding this comment.
One quick change is needed from me. The develop branch is currently code-named Neon.
| ``method_call`` | ||
| --------------- | ||
|
|
||
| .. versionadded:: develop |
Contributor
There was a problem hiding this comment.
Suggested change
| .. versionadded:: develop | |
| .. versionadded:: Neon |
Per @rallytime review
Contributor
|
@rallytime I just went ahead and changed it if you would like to re-review this, please. |
rallytime
approved these changes
Oct 23, 2018
Contributor
|
Port to master #56765 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The purpose of this PR is to introduce a
method_callJinja filter which by itself doesn't expose new functionality, but when carefully used with other filters, likemap(), can lead to significant reduction in templating boilerplate.