#NEWLINE# def execute_sql( self , result_type ) : #NEWLINE# #INDENT# '\n        Execute the specified update. Returns the number of rows affected by\n        the primary update query. The "primary update query" is the first\n        non-empty query that is executed. Row counts for any subsequent,\n        related queries are not available.\n        ' #NEWLINE# cursor = super ( SQLUpdateCompiler , self ) . execute_sql ( self ) #NEWLINE# rows = ( ( cursor and cursor . rowcount ) or 0 ) #NEWLINE# is_empty = ( cursor is None ) #NEWLINE# del cursor #NEWLINE# for query in self . query . get_related_updates ( ) : #NEWLINE# #INDENT# aux_rows = query . get_compiler ( self . using ) . execute_sql ( result_type ) #NEWLINE# if is_empty : #NEWLINE# #INDENT# rows = aux_rows #NEWLINE# is_empty = False #NEWLINE# #UNINDENT# #UNINDENT# return rows