#NEWLINE# @ register . filter #NEWLINE# def flatten( records , fld ) : #NEWLINE# #INDENT# ' Flatten a recordset to list of a particular field\n    :param records: the recordset to flatten\n    :param fld: the field from the records to include in list\n    :return: a list\n    ' #NEWLINE# return ( [ path for fields in records . values_list ( fld ) for path in fields ] if records else [ ] )