def execute_sql(self, result_type):
    '\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        '
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
    try:
        rows = (cursor.rowcount if cursor else 0)
        is_empty = (cursor is None)
    finally:
        if cursor:
            cursor.close()
    for query in self.query.get_related_updates():
        aux_rows = query.get_compiler(self.using).execute_sql(result_type)
        if (is_empty and aux_rows):
            rows = aux_rows
            is_empty = False
    return rows
Execute the specified update. Returns the number of rows affected by
the primary update query. The "primary update query" is the first
non-empty query that is executed. Row counts for any subsequent,
related queries are not available.
def execute_sql(self, result_type):
    '\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        '
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
    try:
        rows = (cursor.rowcount if cursor else 0)
        is_empty = (cursor is None)
    finally:
        if cursor:
            cursor.close()
    for query in self.query.get_related_updates():
        aux_rows = query.get_compiler(self.using).execute_sql(result_type)
        if (is_empty and aux_rows):
            rows = aux_rows
            is_empty = False
    return rows