Since not every function call gets the `using` param passed to it, but
most get the `instance` like when it wants to get a pk value prior to
saving.
I was wondering if it's possible to move that `self._state.db = using` up.
--
Ticket URL: <https://code.djangoproject.com/ticket/27614>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
Does the test suite pass with the change?
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:1>
* status: new => closed
* resolution: => needsinfo
Comment:
The proposed change doesn't seem to work, at least
`multiple_database.tests.RouterTestCase.test_deferred_models` fails. Feel
free to reopen if you have a working patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:2>
Comment (by Joseph Kahn):
I created a PR with a change that doesn't break that test but fixes it for
a lot of the edge cases I run into with multiple databases.
https://github.com/django/django/pull/7841
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:3>
* status: closed => new
* resolution: needsinfo =>
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:4>
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
* type: Uncategorized => Cleanup/optimization
* needs_tests: 0 => 1
Comment:
Tentatively accepting, although I haven't analyzed this in detail. Perhaps
adding a test to the pull request will clarify the use case.
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:5>
* has_patch: 1 => 0
Comment:
The pull request has been withdrawn.
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:6>
* owner: nobody => Paul Cameron
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/27614#comment:7>