module documentation

The main QuerySet implementation. This provides the public API for the ORM.

Class BaseIterable Undocumented
Class EmptyQuerySet Marker class to checking if a queryset is empty by .none(): isinstance(qs.none(), EmptyQuerySet) -> True
Class FlatValuesListIterable Iterable returned by QuerySet.values_list(flat=True) that yields single values.
Class InstanceCheckMeta Undocumented
Class ModelIterable Iterable that yields a model instance for each row.
Class NamedValuesListIterable Iterable returned by QuerySet.values_list(named=True) that yields a namedtuple for each row.
Class Prefetch Undocumented
Class QuerySet Represent a lazy database lookup for a set of objects.
Class RawModelIterable Iterable that yields a model instance for each row from a raw queryset.
Class RawQuerySet Provide an iterator which converts the results of raw SQL queries into annotated model instances.
Class RelatedPopulator RelatedPopulator is used for select_related() object instantiation.
Class ValuesIterable Iterable returned by QuerySet.values() that yields a dict for each row.
Class ValuesListIterable Iterable returned by QuerySet.values_list(flat=False) that yields a tuple for each row.
Function get_prefetcher For the attribute 'through_attr' on the given instance, find an object that has a get_prefetch_queryset(). Return a 4 tuple containing: (the object with get_prefetch_queryset (or None), the descriptor object representing this relationship (or None), a boolean that is False if the attribute was not found at all, a function that takes an instance and returns a boolean that is True if the attribute has already been fetched for that instance)...
Function get_related_populators Undocumented
Function normalize_prefetch_lookups Normalize lookups into Prefetch objects.
Function prefetch_one_level Helper function for prefetch_related_objects().
Function prefetch_related_objects Populate prefetched object caches for a list of model instances based on the lookups/Prefetch instances given.
Constant MAX_GET_RESULTS Undocumented
Constant REPR_OUTPUT_SIZE Undocumented
def get_prefetcher(instance, through_attr, to_attr): (source)

For the attribute 'through_attr' on the given instance, find an object that has a get_prefetch_queryset(). Return a 4 tuple containing: (the object with get_prefetch_queryset (or None), the descriptor object representing this relationship (or None), a boolean that is False if the attribute was not found at all, a function that takes an instance and returns a boolean that is True if the attribute has already been fetched for that instance)

def get_related_populators(klass_info, select, db): (source)

Undocumented

def normalize_prefetch_lookups(lookups, prefix=None): (source)

Normalize lookups into Prefetch objects.

def prefetch_one_level(instances, prefetcher, lookup, level): (source)

Helper function for prefetch_related_objects(). Run prefetches on all instances using the prefetcher object, assigning results to relevant caches in instance. Return the prefetched objects along with any additional prefetches that must be done due to prefetch_related lookups found from default managers.

def prefetch_related_objects(model_instances, *related_lookups): (source)

Populate prefetched object caches for a list of model instances based on the lookups/Prefetch instances given.

MAX_GET_RESULTS: int = (source)

Undocumented

Value
21
REPR_OUTPUT_SIZE: int = (source)

Undocumented

Value
20