mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-03-16 22:40:24 +00:00
Fix bug causing some subscription queries to use inefficient SQL.
This commit is contained in:
parent
f1fb3d76ab
commit
4c0fd40ebd
1 changed files with 1 additions and 1 deletions
|
|
@ -285,7 +285,7 @@ class Collection(APIMixin):
|
|||
name, rel = (user_rel.split('__', 1) + [None])[:2]
|
||||
field = meta.pk if name == 'pk' else meta.get_field(name)
|
||||
# generate `filter_obj` (instance of django.db.models.Q)
|
||||
if field not in meta.local_fields:
|
||||
if field.related_model is not None:
|
||||
# user_rel spans a join - ensure efficient SQL is generated
|
||||
# such as `...WHERE foo_id IN (SELECT foo.id FROM ...)`
|
||||
# rather than creating an explosion of INNER JOINS.
|
||||
|
|
|
|||
Loading…
Reference in a new issue