@register.filter
def flatten(records, fld):
    return [path for fields in records.values_list(fld) for path in fields] if records else []
Flatten a recordset to list of a particular field
dataset/ETHPy150Open Wtower/django-ninecms/ninecms/templatetags/ninecms_extras.py/flatten