Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get the information it needs.
Variable | ExplainInfo |
Undocumented |
Variable | JoinInfo |
Undocumented |
Class | JoinPromoter |
A class to abstract away join promotion problems for complex filter conditions. |
Class | Query |
A single SQL query. |
Class | RawQuery |
A single raw SQL query. |
Function | add_to_dict |
Add "value" to the set of values for "key", whether or not "key" already exists. |
Function | get_children_from_q |
Undocumented |
Function | get_field_names_from_opts |
Undocumented |
Function | get_order_dir |
Return the field name and direction for an order specification. For example, '-foo' is returned as ('foo', 'DESC'). |
Function | is_reverse_o2o |
Check if the given field is reverse-o2o. The field is expected to be some sort of relation field or related object. |