diff options
| author | Tim Graham <timograham@gmail.com> | 2012-09-15 08:15:54 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2012-09-15 08:15:54 -0400 |
| commit | 93e6733e4cbbdad34f1f0f59303ae01f577e4e58 (patch) | |
| tree | 4a4304cd7b7e5cbd8fecebbb678e6195bcaf4c48 | |
| parent | 22242c510f84c53803afe2907649c892cb1b3d9a (diff) | |
Fixed #18131 - Documented ContentTypeManager.get_for_id; thanks sir_sigurd for the report.
| -rw-r--r-- | docs/ref/contrib/contenttypes.txt | 8 |
1 files changed, 8 insertions, 0 deletions
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 |
