* ui_ux: => 0
* stage: Design decision needed => Accepted
Comment:
Since this is obviously a problem, I'm marking the ticket as accepted.
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by esimorre):
see similar ticket #19068
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:9>
* cc: albrecht.andi@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:10>
* cc: 4glitch@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:11>
* cc: django@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:12>
Comment (by Joe <jac@…>):
4glitch, I think your patch would also need to address
ContentType.get_all_objects_for_this_type(). Applying the same fix that
you used for ContentType.get_object_for_this_type() seems to work for me,
i.e.:
Old:
{{{
173 return
self.model_class()._base_manager.using(self._state.db).filter(**kwargs)
}}}
New:
{{{
173 return
self.model_class()._base_manager.using(router.db_for_read
(self.model_class()) or DEFAULT_DB_ALIAS).filter(**kwargs)
}}}
That said, I haven't tested your patch or this proposed modification
thoroughly yet.
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:13>
Comment (by claudep):
Thanks, but tests are still missing...
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:14>
Comment (by socketubs):
If I understand correctly why these patches are not applied, it's just
because tests are missing ?
I can help for writing tests but I have never contributed to Django...
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:15>
Comment (by timo):
We have [https://docs.djangoproject.com/en/dev/internals/contributing/ a
lot of documentation] with tips for new contributors. You may find the
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/submitting-patches/#patch-review-checklist patch review checklist]
particularly helpful.
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:16>
Comment (by Dmitri Bogomolov <4glitch@…>):
I cannot reproduce this issue on two sqlite databases (`test_sqlite`).
Probably need another backend.
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:17>
Comment (by timgraham):
Might be a duplicate of #16281 as the patch proposed there also modifies
these methods.
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:18>
* cc: bcail (added)
Comment:
The GenericForeignKey docs
(https://docs.djangoproject.com/en/5.0/ref/contrib/contenttypes/#django.contrib.contenttypes.fields.GenericForeignKey)
talk about having a ForeignKey to ContentType. Would that ForeignKey work
in this case, though, where ContentType is in a different database?
--
Ticket URL: <https://code.djangoproject.com/ticket/15610#comment:19>