From 93e6733e4cbbdad34f1f0f59303ae01f577e4e58 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 15 Sep 2012 08:15:54 -0400 Subject: [PATCH] Fixed #18131 - Documented ContentTypeManager.get_for_id; thanks sir_sigurd for the report. --- docs/ref/contrib/contenttypes.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt index 0226435159..e98da6e429 100644 --- a/docs/ref/contrib/contenttypes.txt +++ b/docs/ref/contrib/contenttypes.txt @@ -187,6 +187,14 @@ The ``ContentTypeManager`` probably won't ever need to call this method yourself; Django will call it automatically when it's needed. + .. method:: get_for_id(id) + + Lookup a :class:`~django.contrib.contenttypes.models.ContentType` by ID. + Since this method uses the same shared cache as + :meth:`~django.contrib.contenttypes.models.ContentTypeManager.get_for_model`, + it's preferred to use this method over the usual + ``ContentType.objects.get(pk=id)`` + .. method:: get_for_model(model[, for_concrete_model=True]) Takes either a model class or an instance of a model, and returns the