Refs #31502 -- Made minor edits to Model._state docs.

This commit is contained in:
Adam Johnson 2020-07-15 10:27:46 +01:00 committed by Mariusz Felisiak
parent faa6d41cda
commit 5ef6f62634
2 changed files with 8 additions and 7 deletions

View file

@ -239,9 +239,10 @@ database usage. Whenever a query needs to know which database to use,
it calls the master router, providing a model and a hint (if
available). Django then tries each router in turn until a database
suggestion can be found. If no suggestion can be found, it tries the
current ``_state.db`` of the hint instance. If a hint instance wasn't
provided, or the instance doesn't currently have database state, the
master router will allocate the ``default`` database.
current :attr:`instance._state.db <django.db.models.Model._state>` of the hint
instance. If a hint instance wasn't provided, or :attr:`instance._state.db
<django.db.models.Model._state>` is ``None``, the master router will allocate
the ``default`` database.
An example
----------