'Build a view of a list of attachments.'

@classmethod
def list(cls, attachments, detail=False):

    func = (cls.detail if detail else cls.summary)
    return {'attachments': [func(attachment, flat=True) for attachment in attachments]}
