Changes between Initial Version and Version 1 of Ticket #37300, comment 3
- Timestamp:
- Aug 26, 2026, 5:46:05 PM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37300, comment 3
initial v1 1 I reproduced this on current main and opened PR: https://github.com/django/django/pull/218281 I reproduced this regression locally and prepared a patch with regression tests. 2 2 3 The regression happens for both custom forward FK prefetch querysets and custom reverse O2O prefetch querysets. In both cases, the custom queryset no longer receives the parent instance hint, so routers can choose the wrong database. 4 5 The PR restores `_add_hints(instance=instances[0])` in both descriptor paths and adds multi-database regression tests for `Book.editor` and `User.userprofile`. 6 7 Locally tested with: 3 The patch restores the missing routing hint for custom Prefetch querysets in the forward ForeignKey and reverse OneToOne descriptor paths. With PYTHONPATH pointed at the checkout, the multiple_database test suite passes: 8 4 9 5 {{{ 10 python tests/runtests.py multiple_database --verbosity16 PYTHONPATH=. python tests/runtests.py multiple_database --verbosity 1 --parallel 1 11 7 }}} 8 9 The PR was auto-closed because the ticket is still Unreviewed. Could a triager please review whether this should be marked Accepted? Once accepted and assigned, I can reopen or recreate the PR.