Utilities for working with Django Models.
Fetches a dict of model details for model instances with the given ids, keyed by their id.
If a fields list is given, a dict of details will be retrieved for each model, otherwise complete model instances will be retrieved.
Any fields list given shouldn’t contain the primary key attribute for the model, as this can be determined from its Options.
Retrieves ContentType and content objects for the given list of items which use a generic relation, grouping the retrieval of content objects by model to reduce the number of queries executed.
This results in number_of_content_types + 1 queries rather than the number_of_generic_reL_objects * 2 queries you’d get by iterating over the list and accessing each item’s object attribute.
If a dict mapping model classes to field names is given, only the given fields will be looked up for each model specified and the object cache will be populated with a dict of the specified fields. Otherwise, complete model instances will be retrieved.
Populates caches for the given related Model in instances of objects which have a ForeignKey relationship to it, specified as a list of (object list, related attribute name list) two-tuples.
If a list of field names is given, only the given fields will be looked up and related object caches will be populated with a dict of the specified fields. Otherwise, complete model instances will be retrieved.