Left: | ||
Right: |
LEFT | RIGHT |
---|---|
(no file at all) | |
1 from jinja2 import environmentfilter | |
2 | |
3 @environmentfilter | |
4 def find(environment, sequence, value, attribute=None): | |
5 for item in sequence: | |
6 if (item if attribute is None else environment.getitem(item, attribute)) == value: | |
7 return item | |
8 return None | |
LEFT | RIGHT |