Code that expects a Django queryset (like django-rest-framework) will call .all() on a the query set to retrieve the results and then perform slicing on them for pagination. I'd prefer that a different method name be chosen (like fetch_all()) to not conflict with the Django expectations.
As it says in the django queryset docs:
Returns a copy of the current QuerySet
Outside of this conflict, I've been able to use ElasticUtils queries in lieu of django querysets without impact on django-rest-framework since their API overlaps so consistently.
At the time I was thinking this isn't something we want to deal with, but I'm rethinking that.
This issue covers:
fixing .all() to do what the Django QuerySet .all() does--namely return itself
renaming the current .all() to something else like .all_results() or .everything() or something like that
From pull #196:
At the time I was thinking this isn't something we want to deal with, but I'm rethinking that.
This issue covers:
.all()
to do what the Django QuerySet.all()
does--namely return itself.all()
to something else like.all_results()
or.everything()
or something like that