#NEWLINE# def get_object_as_list( model , obj ) : #NEWLINE# #INDENT# 'Get the SQLAlchemy query result as a list of tuples' #NEWLINE# list_display = model . get_list_display ( ) #NEWLINE# result = [ ( 'id' , obj . id ) ] #NEWLINE# result += [ ( col , getattr ( obj , col ) ) for col in list_display ] #NEWLINE# print ( result ) #NEWLINE# return result