Skip to content

Conversation

@gordol
Copy link

@gordol gordol commented Apr 23, 2016

Fixes #1086
Also merged test from #1072 and passing.


This change is Reviewable

@gordol
Copy link
Author

gordol commented Apr 23, 2016

The problem was self._has_more checks the result_cache length, but we should be checking the full length of the entire queryset. So instead of StopIteration at ITER_CHUNK_SIZE we stop when we get to the end of the queryset.

queryset.rewind()
return queryset

def __len__(self):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise: TypeError: object of type 'QuerySetNoCache' has no len()

@gordol
Copy link
Author

gordol commented Apr 23, 2016

Also fixes bug where len() of QuerySetNoCache was failing.

@gordol
Copy link
Author

gordol commented Apr 23, 2016

I tried to pull master, but there are no changes... not sure why it thinks there are merge conflicts? It merges locally fine with no conflicts.

@wojcikstefan
Copy link
Member

Thanks for the contribution @gordol. However, I believe #1427 is the proper fix for this issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants