add custom template tag to get ordered air quality indices

This commit is contained in:
Frédéric Péters 2018-09-25 20:47:18 +02:00
parent 5cae14effc
commit 2a48ad2a6a
1 changed files with 6 additions and 0 deletions

View File

@ -716,3 +716,9 @@ def get_goto_cell(page, request):
@register.assignment_tag
def get_collectivity_slugs():
return COLLECTIVITY_LABELS.keys()
@register.filter
def indice_values(indices):
for key in ('indice_j-1', 'indice_j', 'indice_j+1'):
if indices.get(key):
yield indices.get(key)