module documentation

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.

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.
Constant EXPLAIN_OPTIONS_PATTERN Undocumented
Constant FORBIDDEN_ALIAS_PATTERN Undocumented
Variable ExplainInfo Undocumented
Variable JoinInfo Undocumented
def add_to_dict(data, key, value): (source)

Add "value" to the set of values for "key", whether or not "key" already exists.

def get_children_from_q(q): (source)

Undocumented

def get_field_names_from_opts(opts): (source)

Undocumented

def get_order_dir(field, default='ASC'): (source)

Return the field name and direction for an order specification. For example, '-foo' is returned as ('foo', 'DESC'). The 'default' param is used to indicate which way no prefix (or a '+' prefix) should sort. The '-' prefix always sorts the opposite way.

def is_reverse_o2o(field): (source)

Check if the given field is reverse-o2o. The field is expected to be some sort of relation field or related object.

EXPLAIN_OPTIONS_PATTERN = (source)

Undocumented

Value
_lazy_re_compile('[\\w\\-]+')
FORBIDDEN_ALIAS_PATTERN = (source)

Undocumented

Value
_lazy_re_compile('[\'`\\"\\]\\[;\\s]|--|/\\*|\\*/')
ExplainInfo = (source)

Undocumented

JoinInfo = (source)

Undocumented