diff options
| author | Ben Cail <bcail@crossway.org> | 2023-11-15 14:32:03 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-02-05 08:25:23 +0100 |
| commit | 02a600ff67f7b106cdcab22310bacea98c1a26ba (patch) | |
| tree | 5806f49c4417747082eceed3f84422c0f3203016 /docs | |
| parent | a47de0d6cd440d4515ede48df8335d91d7ac7793 (diff) | |
Fixed #16281 -- Fixed ContentType.get_object_for_this_type() in a multiple database setup.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/contenttypes.txt | 9 |
1 files changed, 7 insertions, 2 deletions
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 <field-lookups-intro>` for the model the :class:`~django.contrib.contenttypes.models.ContentType` represents, and does :meth:`a get() lookup <django.db.models.query.QuerySet.get>` - 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() |
