fix .all() #200

Closed
willkg opened this Issue Jan 31, 2014 · 2 comments

1 participant

@willkg
Mozilla member

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 willkg self-assigned this Feb 28, 2014
@willkg willkg added this to the 0.9 milestone Feb 28, 2014
@willkg
Mozilla member

Working on this now.

@willkg
Mozilla member

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()
@willkg willkg added a commit to willkg/elasticutils that referenced this issue Feb 28, 2014
@willkg willkg Switch .all() to .everything()
* switch the old .all() to .everything()
* change .all() to be more like what Django ModelManager/QuerySet does

Fixes #200
12896ec
@willkg willkg added a commit to willkg/elasticutils that referenced this issue Feb 28, 2014
@willkg willkg Switch .all() to .everything()
* switch the old .all() to .everything()
* change .all() to be more like what Django ModelManager/QuerySet does

Fixes #200
c81e903
@willkg willkg added a commit that closed this issue Feb 28, 2014
@willkg willkg Switch .all() to .everything()
* switch the old .all() to .everything()
* change .all() to be more like what Django ModelManager/QuerySet does

Fixes #200
58ccf86
@willkg willkg closed this in 58ccf86 Feb 28, 2014
@eire1130 eire1130 added a commit to eire1130/elasticutils that referenced this issue Mar 15, 2014
@willkg willkg Switch .all() to .everything()
* switch the old .all() to .everything()
* change .all() to be more like what Django ModelManager/QuerySet does

Fixes #200
f7b3d12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment