#NEWLINE# def to_json( self ) : #NEWLINE# #INDENT# result = dict ( ) #NEWLINE# for key in self . __mapper__ . c . keys ( ) : #NEWLINE# #INDENT# col = getattr ( self , key ) #NEWLINE# if ( isinstance ( col , datetime . datetime ) or isinstance ( col , datetime . date ) ) : #NEWLINE# #INDENT# col = col . isoformat ( ) #NEWLINE# #UNINDENT# result [ key ] = col #NEWLINE# #UNINDENT# return result