Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing pagination for search results #598

Open
svanderwulp opened this issue Mar 21, 2023 · 3 comments
Open

Missing pagination for search results #598

svanderwulp opened this issue Mar 21, 2023 · 3 comments

Comments

@svanderwulp
Copy link
Contributor

Endpoint search recipients is paginated, but corresponding method returns Python list with just the first page of the result.
I expected it to return a PaginatedList, but maybe the lists item type isn't easy to implement (either user of context)?

@bennettscience
Copy link
Contributor

If you look at the network tab for a request, is a Link header included? The problem is that not all results are paginated. According to the docs, if you search using a user_id, you only get one response, never a paginated response.

Here's the relevant method on the canvas object.

@svanderwulp
Copy link
Contributor Author

A Link header is included in the response. I am willing to fix the missing pagination, but unsure how to go about creating a PaginatedList which might contain multiple types of instances (User, Context). When I limit the search results to objects of type 'user' (as per description in API documentation), I am able to get a fully functional PaginatedList.

Maybe there is an example of a PaginatedList list containing multiple object types elsewhere in the code I could use as an example for a fix?

@bennettscience
Copy link
Contributor

Yeah, this is a known issue with PaginatedList (see #175, #114, and #498). @jessemcbride also mentions it as a requirement on #114.

I think the closest you could get is to use the method from #498 where the GradeChangeEvent object incudes an event_type attribute that can be filtered after collecting the PaginatedList response, but I'm not sure what kind of precedent that would set for the rest of the library.

This would also affect #175.

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

No branches or pull requests

2 participants