#28717: Admin always queries default database when rendering a list_filter on a
ForeignKey
-------------------------------+--------------------------------------
     Reporter:  Adam Brenecki  |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Uncategorized  |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Tomer Chachamu):

 Yep, that's an oversight in the documentation. However, you can remove the
 admin customisation and write a database router instead. That will work
 not just for the admin but throughout your website too. If you are setting
 `request.applyol` in middleware, you can in the same middleware tell your
 database router to change the database that it should give for
 `db_for_read(model=ApplyOl)`. Here's an example you can adapt:
 
https://github.com/yandex/django_replicated/blob/master/django_replicated/router.py

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28717#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.75d60e1a1c9cc089632d7567b6e1c818%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to