Skip to content

Conversation

@Hellowlol
Copy link
Collaborator

@Hellowlol Hellowlol commented Apr 26, 2020

Now we still 1 more http call then we need as we just asks for any data until the subresult is empty.

If we override fetch item we could use totalSize to check if we have all possible items or not.

@Hellowlol
Copy link
Collaborator Author

@Montellese Does solve your issue with search?

Copy link
Contributor

@Montellese Montellese left a comment

Choose a reason for hiding this comment

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

The feature set looks good but I proposed some improvements for the handling of container_size and maxresults in LibrarySection.search().

@Hellowlol
Copy link
Collaborator Author

I think this should be good to go. @Montellese ?

raise NotFound('Unable to find elem: cls=%s, attrs=%s' % (clsname, kwargs))

def fetchItems(self, ekey, cls=None, **kwargs):
def fetchItems(self, ekey, cls=None, container_start=None, container_size=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

How is it possible now to pass container_start and container_size through e.g. LibrarySection.all()? Before it was possible through **kwargs but now it would have to be passed through explicitly which is currently not the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Kwargs can replace keyword arguments. We still test for this.

Add some test that verify that we cant get in a enless loop and handle container_start corrently.
@Hellowlol Hellowlol mentioned this pull request Apr 30, 2020
@Hellowlol
Copy link
Collaborator Author

@Montellese Wanna take a look before i hit merge?

Copy link
Contributor

@Montellese Montellese left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@Hellowlol Hellowlol merged commit 437eea8 into master May 1, 2020
@Hellowlol Hellowlol deleted the batchsearch branch May 1, 2020 18:08
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