mozilla / elasticutils

[deprecated] A friendly chainable ElasticSearch interface for python
http://elasticutils.rtfd.org
BSD 3-Clause "New" or "Revised" License
243 stars 76 forks source link

fix .all() #200

Closed willkg closed 10 years ago

willkg commented 10 years ago

From pull #196:

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:

  1. fixing .all() to do what the Django QuerySet .all() does--namely return itself
  2. renaming the current .all() to something else like .all_results() or .everything() or something like that
willkg commented 10 years ago

Working on this now.

willkg commented 10 years ago

This requires:

  1. changing the code for .all() and creating a new .everything()
  2. updating the tests for .all() and creating a new test for .everything()
  3. updating the documentation for .all() and creating new docs for .everything()