From 02a600ff67f7b106cdcab22310bacea98c1a26ba Mon Sep 17 00:00:00 2001 From: Ben Cail Date: Wed, 15 Nov 2023 14:32:03 -0500 Subject: Fixed #16281 -- Fixed ContentType.get_object_for_this_type() in a multiple database setup. --- docs/ref/contrib/contenttypes.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt index 71feee63e0..fa44679659 100644 --- a/docs/ref/contrib/contenttypes.txt +++ b/docs/ref/contrib/contenttypes.txt @@ -106,13 +106,18 @@ methods that allow you to get from a :class:`~django.contrib.contenttypes.models.ContentType` instance to the model it represents, or to retrieve objects from that model: -.. method:: ContentType.get_object_for_this_type(**kwargs) +.. method:: ContentType.get_object_for_this_type(using=None, **kwargs) Takes a set of valid :ref:`lookup arguments ` for the model the :class:`~django.contrib.contenttypes.models.ContentType` represents, and does :meth:`a get() lookup ` - on that model, returning the corresponding object. + on that model, returning the corresponding object. The ``using`` argument + can be used to specify a different database than the default one. + + .. versionchanged:: 5.1 + + The ``using`` argument was added. .. method:: ContentType.model_class() -- cgit v1.3