class A(models.Model):
id = models.AutoField(primary_key=True)
b = models.ForeignKey(B, on_delete=models.CASCADE, db_constraint=False )
class B(models.Model):
someinfo = model.CharField()
# model A are from db named 'database2'
# model B are from db named 'default'
DB router is correctly set for both models using the app label of each model.
Model A and B are from two different Django apps, and are put together here for simplicity.
Now if I do
A.objects.all().values('b__someinfo')
I wouldn’t get any value for ‘b__someinfo’ as b ‘does not exist in database2’ despite I have correctly set the db router to route to ‘default’ for model B and route to ‘database2’ for model A.
I have read that there are limitations for multi db relations in Django, just wants to know if I’m doing anything wrong here or will this be supported anytime soon.