class documentation

class ContentTypeManager(models.Manager):

View In Hierarchy

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}.
Method __init__ Undocumented
Method ​_add​_to​_cache Insert a ContentType into the cache.
Method ​_get​_from​_cache Undocumented
Method ​_get​_opts Undocumented
Class Variable use​_in​_migrations Undocumented
Instance Variable ​_cache Undocumented
def clear_cache(self):
Clear out the content-type cache.
def get_by_natural_key(self, app_label, model):

Undocumented

def get_for_id(self, 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).
def get_for_model(self, model, for_concrete_model=True):
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):
Given *models, return a dictionary mapping {model: content_type}.
def __init__(self, *args, **kwargs):

Undocumented

def _add_to_cache(self, using, ct):
Insert a ContentType into the cache.
def _get_from_cache(self, opts):

Undocumented

def _get_opts(self, model, for_concrete_model):

Undocumented

use_in_migrations: bool =

Undocumented

_cache: dict =

Undocumented