#26163: Wrong related fields in ._meta.get_fields with multiple database on
foreignkey
-------------------------------------+-------------------------------------
     Reporter:  aRkadeFR             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.9
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  models, meta,        |             Triage Stage:
  get_fields, fields, router,        |  Unreviewed
  multiple, databases                |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by charettes):

 Hi aRkadeFR,

 From what I can see `GroupA` deletion triggered cascade deletion attempts
 of `ModelB` which is normal because of the FK relationships you defined
 (`GroupA` < -- o2o --> `Group` <-- fk -- `ModelB`).

 Because of your router definition the `app_modelb` table is not created on
 the `default` database and thus defines a cross-database relationship
 (even if you `auth_group` table is in both databases) with `GroupA` in the
 context of the database used for its writes (`router.db_for_write(GroupA)
 is None` -> `default`).

 I won't go into more details about you question because this ticket
 tracker is not a support channel but an application to track bugs. If you
 want to get help to set things up please submit your question to the
 mailing list or join the #django IRC channel.

--
Ticket URL: <https://code.djangoproject.com/ticket/26163#comment:4>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.be5007c4d24768c0352f872d2eae8ab8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to