python3: add list filter tag, useful to convert dictionary views

This commit is contained in:
Frédéric Péters 2018-03-31 20:30:15 +02:00
parent e81294ed17
commit 1bd5333cb5
1 changed files with 4 additions and 0 deletions

View File

@ -220,3 +220,7 @@ def get_group(group_list, group_name):
@register.filter(name='is_empty_placeholder')
def is_empty_placeholder(page, placeholder_name):
return len([x for x in page.get_cells() if x.placeholder == placeholder_name]) == 0
@register.filter(name='list')
def as_list(obj):
return list(obj)