You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up during the implementation of the map filter (#441) and I wanted to create an issue to allow for some discussion before the API gets locked down for v1.0.
There are some jinja capabilities that don't appear to be possible to implement with the current filter/test API. For example, map has a mode where each item of an array can be run through a function. Some other examples include reject/rejectattr/select/selectattr where a test predicate is supplied.
The initial solution provided a reference to the Tera instance to the filter API. Could you elaborate on why that solution can't work, or any alternate designs that could allow for these implementations? Thanks.
The text was updated successfully, but these errors were encountered:
Filters are traits so you can have whatever context you want, including a Tera instance. I think it's better for now to not support those filters as built-in and if someone want them, it's easy to implement in their own projects. Maybe my use cases are simpler for template engines but I have never used any of those :/
This came up during the implementation of the map filter (#441) and I wanted to create an issue to allow for some discussion before the API gets locked down for v1.0.
There are some jinja capabilities that don't appear to be possible to implement with the current filter/test API. For example, map has a mode where each item of an array can be run through a function. Some other examples include reject/rejectattr/select/selectattr where a test predicate is supplied.
The initial solution provided a reference to the Tera instance to the filter API. Could you elaborate on why that solution can't work, or any alternate designs that could allow for these implementations? Thanks.
The text was updated successfully, but these errors were encountered: