class documentation

Undocumented

Method as_sql Create the SQL for this query. Return the SQL string and list of parameters.
Method execute_sql Execute the specified update. Return 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.
Method pre_sql_setup If the update depends on results from other tables, munge the "where" conditions to match the format required for (portable) SQL updates.

Inherited from SQLCompiler:

Method __init__ Undocumented
Method __repr__ Undocumented
Method apply_converters Undocumented
Method as_subquery_condition Undocumented
Method collapse_group_by Undocumented
Method compile Undocumented
Method deferred_to_columns Convert the self.deferred_loading data structure to mapping of table names to sets of column names which are to be loaded. Return the dictionary.
Method explain_query Undocumented
Method find_ordering_name Return the table alias (the name might be ambiguous, the alias will not be) and column name for ordering by the given 'name' parameter. The 'name' is of the form 'field1__field2__...__fieldN'.
Method get_combinator_sql Undocumented
Method get_converters Undocumented
Method get_default_columns Compute the default columns for selecting every field in the base model. Will sometimes be called to pull in related models (e.g. via select_related), in which case "opts" and "start_alias" will be given to provide a starting point for the traversal.
Method get_distinct Return a quoted list of fields to use in DISTINCT ON part of the query.
Method get_extra_select Undocumented
Method get_from_clause Return a list of strings that are joined together to go after the "FROM" part of the query, as well as a list any extra parameters that need to be included. Subclasses, can override this to create a from-clause via a "select".
Method get_group_by Return a list of 2-tuples of form (sql, params).
Method get_order_by Return a list of 2-tuples of the form (expr, (sql, params, is_ref)) for the ORDER BY clause.
Method get_related_selections Fill in the information needed for a select_related query. The current depth is measured as the number of connections away from the root model (for example, cur_depth=1 means we are looking at models with direct connections to the root model).
Method get_select Return three values: - a list of 3-tuples of (expression, (sql, params), alias) - a klass_info structure, - a dictionary of annotations
Method get_select_for_update_of_arguments Return a quoted list of arguments for the SELECT FOR UPDATE OF part of the query.
Method has_results Backends (e.g. NoSQL) can override this in order to use optimized versions of "query has any results."
Method quote_name_unless_alias A wrapper around connection.ops.quote_name that doesn't quote aliases for table names. This avoids problems with some SQL dialects that treat quoted strings specially (e.g. PostgreSQL).
Method results_iter Return an iterator over the results from executing this query.
Method setup_query Undocumented
Class Variable ordering_parts Undocumented
Instance Variable annotation_col_map Undocumented
Instance Variable col_count Undocumented
Instance Variable connection Undocumented
Instance Variable elide_empty Undocumented
Instance Variable has_extra_select Undocumented
Instance Variable having Undocumented
Instance Variable klass_info Undocumented
Instance Variable query Undocumented
Instance Variable quote_cache Undocumented
Instance Variable select Undocumented
Instance Variable using Undocumented
Instance Variable where Undocumented
Method _order_by_pairs Undocumented
Method _setup_joins Helper method for get_order_by() and get_distinct().
Instance Variable _meta_ordering Undocumented
def as_sql(self): (source)

Create the SQL for this query. Return the SQL string and list of parameters.

def execute_sql(self, result_type): (source)

Execute the specified update. Return 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 pre_sql_setup(self): (source)

If the update depends on results from other tables, munge the "where" conditions to match the format required for (portable) SQL updates. If multiple updates are required, pull out the id values to update at this point so that they don't change as a result of the progressive updates.