So turns out Exists is a subquery, not an aggregation, which means it can't be used in the same way as Count.
Exactly how to correctly modify the queryset for separate subqueries like that looks like it might be pretty complex, especially for n levels of nesting. So for now revert back to the old logic, so it works and doesn't crash!
Reverts dabapps/django-rest-framework-serialization-spec#59
So turns out
Exists
is a subquery, not an aggregation, which means it can't be used in the same way asCount
.Exactly how to correctly modify the queryset for separate subqueries like that looks like it might be pretty complex, especially for
n
levels of nesting. So for now revert back to the old logic, so it works and doesn't crash!Test yo' changes, kids!