Cross database relations
Hello
I have a code like this:
class A(models.Model):
...
class B(models.Model):
a = models.ForeignKey(A)
...
Database router set DIFFERENT databases for reading for this classes
and allowing relations. B.objects.all() result:
SELECT ... FROM A_table LEFT OUTER JOIN B_table ON ... ORDER BY ...
ASC';
So it trying to read both related objects with one query. Of course it
fails.
But when I use B.objects.get(id=123) it works fine...
Is it possible to split "all" query?
Best regards,
Isakov Alexandr
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home