Skip to content

Commit

Permalink
[1.4.x] Fixed #18131 - Documented ContentTypeManager.get_for_id; than…
Browse files Browse the repository at this point in the history
…ks sir_sigurd for the report.

Backport of 93e6733 from master.
  • Loading branch information
timgraham committed Sep 15, 2012
1 parent 18d88a1 commit 421ce44
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/ref/contrib/contenttypes.txt
Expand Up @@ -187,6 +187,14 @@ The ``ContentTypeManager``
probably won't ever need to call this method yourself; Django will call probably won't ever need to call this method yourself; Django will call
it automatically when it's needed. 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) .. method:: get_for_model(model)


Takes either a model class or an instance of a model, and returns the Takes either a model class or an instance of a model, and returns the
Expand Down

0 comments on commit 421ce44

Please sign in to comment.