class documentation
Undocumented
Method | __init__ |
Undocumented |
Method | insert |
Undocumented |
Class Variable | compiler |
Undocumented |
Instance Variable | fields |
Undocumented |
Instance Variable | objs |
Undocumented |
Instance Variable | on |
Undocumented |
Instance Variable | raw |
Undocumented |
Instance Variable | unique |
Undocumented |
Instance Variable | update |
Undocumented |
Inherited from Query
:
Method | __deepcopy__ |
Limit the amount of work when a Query is deepcopied. |
Method | __str__ |
Return the query as a string of SQL with the parameter values substituted in (use sql_with_params() to see the unsubstituted string). |
Method | add |
Add a single annotation expression to the Query. |
Method | add |
Add the given list of model field names to the set of fields to exclude from loading from the database when automatic column selection is done. Add the new field names to any existing field names that are deferred (or removed from any existing field names that are marked as the only ones for immediate loading). |
Method | add |
Add and resolve the given fields to the query's "distinct on" clause. |
Method | add |
Add data to the various extra_* attributes for user-created additions to the query. |
Method | add |
Add the given (model) fields to the select set. Add the field names in the order specified. |
Method | add |
Undocumented |
Method | add |
Undocumented |
Method | add |
Add the given list of model field names to the set of fields to retrieve when the SQL is executed ("immediate loading" fields). The field names replace any existing immediate loading field names. If there are field names already specified for deferred loading, remove those names from the new field_names before storing the new names for immediate loading... |
Method | add |
Add items from the 'ordering' sequence to the query's "order by" clause. These items are either field names (not column names) -- possibly with a direction prefix ('-' or '?') -- or OrderBy expressions. |
Method | add |
A preprocessor for the internal _add_q(). Responsible for doing final join promotion. |
Method | add |
Undocumented |
Method | add |
Set up the select_related data structure so that we only select certain related models (as opposed to all models, when self.select_related=True). |
Method | append |
Undocumented |
Method | as |
Responsible for returning a (sql, [params]) tuple to be included in the current query. |
Method | build |
Build a WhereNode for a single filter clause but don't add it to this Query. Query.add_q() will then add this filter to the where Node. |
Method | build |
Add a FilteredRelation object to the current filter. |
Method | build |
Try to extract transforms and lookup from given lhs. |
Method | build |
Undocumented |
Method | bump |
Change the alias prefix to the next letter in the alphabet in a way that the other query's aliases and this query's aliases will not conflict. Even tables that previously had no alias will get an alias after this call... |
Method | can |
Return True if adding filters to this instance is still possible. |
Method | chain |
Return a copy of the current Query that's ready for another operation. The klass argument changes the type of the Query, e.g. UpdateQuery. |
Method | change |
Change the aliases in change_map (which maps old-alias -> new-alias), relabelling any references to them in select columns and the where clause. |
Method | check |
Undocumented |
Method | check |
Raise an error if expression cannot be used in a WHERE clause. |
Method | check |
Check whether the object passed while querying is of the correct type. If not, raise a ValueError specifying the wrong object. |
Method | check |
Check the type of object passed to query relations. |
Method | clear |
Remove any fields from the deferred loading set. |
Method | clear |
Clear any existing limits. |
Method | clear |
Remove any ordering settings if the current query allows it without side effects, set 'force' to True to clear the ordering regardless. If 'clear_default' is True, there will be no ordering in the resulting query (not even the model's default). |
Method | clear |
Remove all fields from SELECT clause. |
Method | clear |
Clear the list of fields to select (but not extra_select columns). Some queryset types completely replace any existing list of select columns. |
Method | clear |
Undocumented |
Method | clone |
Return a copy of the current Query. A lightweight alternative to deepcopy(). |
Method | combine |
Merge the 'rhs' query into the current one (with any 'rhs' effects being applied *after* (that is, "to the right of") anything in the current query. 'rhs' is not modified during a call to this function. |
Method | count |
Return the number of tables in this query with a non-zero reference count. After execution, the reference counts are zeroed, so tables added in compiler will not be seen by this method. |
Method | deferred |
Convert the self.deferred_loading data structure to an alternate data structure, describing the field that *will* be loaded. This is used to compute the columns to select from the database and also by the QuerySet class to work out which fields are being initialized on each model... |
Method | demote |
Change join type from LOUTER to INNER for all joins in aliases. |
Method | exists |
Undocumented |
Method | explain |
Undocumented |
Method | get |
Return the dictionary with the values of the existing aggregations. |
Method | get |
Undocumented |
Method | get |
Perform a COUNT() query using the current filter constraints. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Return the first alias for this query, after increasing its reference count. |
Method | get |
Return the Options instance (the model._meta) from which to start processing. Normally, this is self.model._meta, but it can be changed by subclasses. |
Method | has |
Undocumented |
Method | has |
Undocumented |
Method | has |
Undocumented |
Method | is |
Undocumented |
Method | is |
Check if the given field should be treated as nullable. |
Method | join |
Return an alias for the 'join', either reusing an existing alias for that join or creating a new one. 'join' is either a base_table_class or join_class. |
Method | join |
Make sure the given 'model' is joined in the query. If 'model' isn't a parent of 'opts' or if it is None this method is a no-op. |
Method | names |
Walk the list of names and turns them into PathInfo tuples. A single name in 'names' can generate multiple PathInfos (m2m, for example). |
Method | promote |
Promote recursively the join type of given aliases and its children to an outer join. If 'unconditional' is False, only promote the join if it is nullable or the parent join is an outer join. |
Method | ref |
Increases the reference count for this alias. |
Method | relabeled |
Undocumented |
Method | reset |
Reset reference counts for aliases so that they match the value passed in `to_counts`. |
Method | resolve |
Provide the chance to do any preprocessing or validation before being added to the query. |
Method | resolve |
Undocumented |
Method | resolve |
Undocumented |
Method | rewrite |
Undocumented |
Method | set |
Set the mask of annotations that will be returned by the SELECT. |
Method | set |
Undocumented |
Method | set |
Set the mask of extra select items that will be returned by SELECT. Don't remove them from the Query since they might be used later. |
Method | set |
Expand the GROUP BY clause required by the query. |
Method | set |
Adjust the limits on the rows retrieved. Use low/high to set these, as it makes it more Pythonic to read and write. When the SQL query is created, convert them to the appropriate offset and limit values. |
Method | set |
Undocumented |
Method | set |
Undocumented |
Method | setup |
Compute the necessary table joins for the passage through the fields given in 'names'. 'opts' is the Options class for the current model (which gives the table we are starting from), 'alias' is the alias for the table to start the joining from. |
Method | solve |
Solve the lookup type from the lookup (e.g.: 'foobar__id__icontains'). |
Method | split |
When doing an exclude against any kind of N-to-many relation, we need to use a subquery. This method constructs the nested query, given the original exclude filter (filter_expr) and the portion up to the first N-to-many relation field. |
Method | sql |
Return the query as an SQL string and the parameters that will be substituted into the query. |
Method | table |
Return a table alias for the given table_name and whether this is a new alias or not. |
Method | trim |
The 'target' parameter is the final field being joined to, 'joins' is the full list of join aliases. The 'path' contain the PathInfos used to create the joins. |
Method | trim |
Trim joins from the start of the join path. The candidates for trim are the PathInfos in names_with_path structure that are m2m joins. |
Method | try |
Helper method for build_lookup(). Try to fetch and initialize a transform for name parameter from lhs. |
Method | unref |
Decreases the reference count for this alias. |
Class Variable | combinator |
Undocumented |
Class Variable | combinator |
Undocumented |
Class Variable | combined |
Undocumented |
Class Variable | empty |
Undocumented |
Class Variable | explain |
Undocumented |
Class Variable | extra |
Undocumented |
Class Variable | filter |
Undocumented |
Class Variable | max |
Undocumented |
Class Variable | select |
Undocumented |
Class Variable | select |
Undocumented |
Class Variable | select |
Undocumented |
Class Variable | select |
Undocumented |
Class Variable | select |
Undocumented |
Class Variable | standard |
Undocumented |
Class Variable | subquery |
Undocumented |
Instance Variable | alias |
Undocumented |
Instance Variable | alias |
Undocumented |
Instance Variable | alias |
Undocumented |
Instance Variable | alias |
Undocumented |
Instance Variable | annotation |
Undocumented |
Instance Variable | annotations |
Undocumented |
Instance Variable | default |
Undocumented |
Instance Variable | default |
Undocumented |
Instance Variable | deferred |
Undocumented |
Instance Variable | distinct |
Undocumented |
Instance Variable | distinct |
Undocumented |
Instance Variable | external |
Undocumented |
Instance Variable | extra |
Undocumented |
Instance Variable | extra |
Undocumented |
Instance Variable | extra |
Undocumented |
Instance Variable | group |
Undocumented |
Instance Variable | high |
Undocumented |
Instance Variable | low |
Undocumented |
Instance Variable | model |
Undocumented |
Instance Variable | order |
Undocumented |
Instance Variable | select |
Undocumented |
Instance Variable | select |
Undocumented |
Instance Variable | subq |
Undocumented |
Instance Variable | table |
Undocumented |
Instance Variable | used |
Undocumented |
Instance Variable | values |
Undocumented |
Instance Variable | where |
Undocumented |
Property | annotation |
Return the dictionary of aggregate columns that are not masked and should be used in the SELECT clause. Cache this result for performance. |
Property | base |
Undocumented |
Property | extra |
Undocumented |
Property | has |
Undocumented |
Property | is |
Undocumented |
Property | output |
Return the output type of this expressions. |
Class Method | _gen |
Undocumented |
Class Method | _gen |
Undocumented |
Method | _add |
Add a Q-object to the current filter. |
Method | _get |
Undocumented |
Instance Variable | _annotation |
Undocumented |
Instance Variable | _extra |
Undocumented |
Instance Variable | _filtered |
Undocumented |
Instance Variable | _lookup |
Undocumented |
Inherited from BaseExpression
(via Query
):
Method | __getstate__ |
Undocumented |
Method | asc |
Undocumented |
Method | copy |
Undocumented |
Method | desc |
Undocumented |
Method | flatten |
Recursively yield this expression and all subexpressions, in depth-first order. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Return the underlying field types used by this aggregate. |
Method | get |
Undocumented |
Method | prefix |
Undocumented |
Method | replace |
Undocumented |
Method | reverse |
Undocumented |
Method | select |
Custom format for select clauses. For example, EXISTS expressions need to be wrapped in CASE WHEN on Oracle. |
Method | set |
Undocumented |
Class Variable | filterable |
Undocumented |
Class Variable | is |
Undocumented |
Class Variable | window |
Undocumented |
Property | conditional |
Undocumented |
Property | contains |
Undocumented |
Property | contains |
Undocumented |
Property | contains |
Undocumented |
Property | convert |
Expressions provide their own converters because users have the option of manually specifying the output_field which may be a different type from the one the database returns. |
Property | field |
Undocumented |
Static Method | _convert |
Undocumented |
Method | _parse |
Undocumented |
Method | _resolve |
Attempt to infer the output type of the expression. |
Class Variable | _output |
Undocumented |
Property | _output |
Return the output field of this expression, or None if _resolve_output_field() didn't return an output type. |