Skip to content
Browse files

Fixed #18131 - Documented ContentTypeManager.get_for_id; thanks sir_s…

…igurd for the report.
  • Loading branch information...
1 parent 22242c5 commit 93e6733e4cbbdad34f1f0f59303ae01f577e4e58 @timgraham timgraham committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 docs/ref/contrib/contenttypes.txt
8 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

0 comments on commit 93e6733

Please sign in to comment.
Something went wrong with that request. Please try again.