#NEWLINE# def sorted_list( self , coll , ignore_id ) : #NEWLINE# #INDENT# to_sort = [ ] #NEWLINE# for doc in coll . find ( ) : #NEWLINE# #INDENT# docstr = '{' #NEWLINE# if ignore_id : #NEWLINE# #INDENT# doc . pop ( '_id' ) #NEWLINE# #UNINDENT# for k in sorted ( doc . keys ( ) ) : #NEWLINE# #INDENT# if ( k == 'uploadDate' ) : #NEWLINE# #INDENT# self . assertTrue ( isinstance ( to_sort [ k ] , datetime . datetime ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# docstr += ( '%s:%s ' % ( k , repr ( doc [ k ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# to_sort . append ( ( docstr + '}' ) ) #NEWLINE# #UNINDENT# return to_sort