misc: add is_empty_placeholder filter tag (#19443)

This commit is contained in:
Frédéric Péters 2017-10-14 22:28:30 +02:00
parent 96208f1f40
commit 7ff033f136
1 changed files with 4 additions and 0 deletions

View File

@ -191,3 +191,7 @@ def get_group(group_list, group_name):
if group['grouper'] == group_name:
ret.extend(group['list'])
return ret
@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