Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties.
Variable | PathInfo |
Undocumented |
Class | DeferredAttribute |
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed. |
Class | FilteredRelation |
Specify custom filtering in the ON clause of SQL joins. |
Class | Q |
Encapsulate filters as objects that can then be combined logically (using & and | ). |
Class | RegisterLookupMixin |
No class docstring; 0/2 method, 1/1 static method, 1/5 class method documented |
Function | check_rel_lookup_compatibility |
No summary |
Function | refs_expression |
Check if the lookup_parts contains references to the given annotations set. Because the LOOKUP_SEP is contained in the default annotation names, check each prefix of the lookup_parts for a match. |
Function | select_related_descend |
No summary |
Function | subclasses |
Undocumented |
Check that self.model is compatible with target_opts. Compatibility is OK if:
- model and opts match (where proxy inheritance is removed)
- model is parent of opts' model or the other way around
Return True if this field should be used to descend deeper for select_related() purposes. Used by both the query construction code (sql.query.fill_related_selections()) and the model instance creation code (query.get_klass_info()).