@json_view(permission='view_tender')
    def collection_get(self):
        if self.request.params.get('all', ''):
            collection_data = [i.serialize("view") for i in self.context.documents]
        else:
            collection_data = sorted(dict([
                (i.id, i.serialize("view"))
                for i in self.context.documents
            ]).values(), key=lambda i: i['dateModified'])
        return {'data': collection_data}
Tender Complaint Documents List
dataset/ETHPy150Open openprocurement/openprocurement.api/src/openprocurement/api/views/complaint_document.py/TenderComplaintDocumentResource.collection_get