def filter_list(list, key, value):
    return [t for t in list if t[key] == value]


class FilterModule(object):

    def filters(self):
        return {'byattr': filter_list}
How to select/reduce a list of dictionaries in Flask/Jinja