dabapps / django-rest-framework-serialization-spec

DEPRECATED, see https://github.com/dabapps/django-readers instead
MIT License
11 stars 0 forks source link

Revert "Use Django's exists aggregation logic for exists" #61

Closed RealOrangeOne closed 3 years ago

RealOrangeOne commented 4 years ago

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 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!

Test yo' changes, kids!