#NEWLINE# def fetchone( self , delete_flag = False ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# result = self . last_select_command . results . next ( ) #NEWLINE# if isinstance ( result , ( int , long ) ) : #NEWLINE# #INDENT# return ( result , ) #NEWLINE# #UNINDENT# query = self . last_select_command . query #NEWLINE# row = [ ] #NEWLINE# for ( col , select ) in query . extra_selects : #NEWLINE# #INDENT# row . append ( result . get ( col ) ) #NEWLINE# #UNINDENT# for col in query . last_select_command . query . init_list : #NEWLINE# #INDENT# row . append ( result . get ( col ) ) #NEWLINE# #UNINDENT# self . returned_ids . append ( result . key ( ) . id_or_name ( ) ) #NEWLINE# return row #NEWLINE# #UNINDENT# except StopIteration : #NEWLINE# #INDENT# return None