#NEWLINE# @ json_view ( permission = 'view_tender' ) #NEWLINE# def collection_get( self ) : #NEWLINE# #INDENT# 'Tender Complaint Documents List' #NEWLINE# if self . request . params . get ( 'all' , '' ) : #NEWLINE# #INDENT# collection_data = [ i . serialize ( 'view' ) for i in self . context . documents ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# collection_data = sorted ( dict ( [ ( i . id , i . serialize ( 'view' ) ) for i in self . context . documents ] ) . values ( ) , key = ( lambda i : i [ 'dateModified' ] ) ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'data' : collection_data , #NEWLINE# #UNINDENT# }