class documentation

class ContentTypeManager(models.Manager): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method clear_cache Clear out the content-type cache.
Method get_by_natural_key Undocumented
Method get_for_id Lookup a ContentType by ID. Use the same shared cache as get_for_model (though ContentTypes are not created on-the-fly by get_by_id).
Method get_for_model Return the ContentType object for a given model, creating the ContentType if necessary. Lookups are cached so that subsequent lookups for the same model don't hit the database.
Method get_for_models Given *models, return a dictionary mapping {model: content_type}.
Class Variable use_in_migrations Undocumented
Method _add_to_cache Insert a ContentType into the cache.
Method _get_from_cache Undocumented
Method _get_opts Undocumented
Instance Variable _cache Undocumented
def __init__(self, *args, **kwargs): (source)

Undocumented

def clear_cache(self): (source)

Clear out the content-type cache.

def get_by_natural_key(self, app_label, model): (source)

Undocumented

def get_for_id(self, id): (source)

Lookup a ContentType by ID. Use the same shared cache as get_for_model (though ContentTypes are not created on-the-fly by get_by_id).

def get_for_model(self, model, for_concrete_model=True): (source)

Return the ContentType object for a given model, creating the ContentType if necessary. Lookups are cached so that subsequent lookups for the same model don't hit the database.

def get_for_models(self, *models, for_concrete_models=True): (source)

Given *models, return a dictionary mapping {model: content_type}.

use_in_migrations: bool = (source)

Undocumented

def _add_to_cache(self, using, ct): (source)

Insert a ContentType into the cache.

def _get_from_cache(self, opts): (source)

Undocumented

def _get_opts(self, model, for_concrete_model): (source)

Undocumented

Undocumented