

@json_view(permission='view_tender')
def collection_get(self):
    'Tender Documents List'
    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,
    }

dataset/ETHPy150Open openprocurement/openprocurement.api/src/openprocurement/api/views/tender_document.py TenderDocumentResource.collection_get/original