Paginate /codes endpoint#3685
Conversation
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
| # We have seats available, so grab some more codes. | ||
| codes_for_output = list(discounts.all()[: contract.max_learners]) | ||
|
|
||
| paginator = PageNumberPagination() |
There was a problem hiding this comment.
It sucks to do this in the view itself - we should probably bite the bullet and paginate the whole viewset.
jkachel
left a comment
There was a problem hiding this comment.
One small thing, but otherwise ready to go.
|
@jkachel Think this is ready for another look! |
6351d78 to
6b1146e
Compare
| class ManagerContractOrgPagination(PageNumberPagination): | ||
| page_size = 25 | ||
| page_size_query_param = "page_size" | ||
| max_page_size = 100 |
There was a problem hiding this comment.
Spoke w/ @daniellefrappier18 about using the /codes endpoint directly to support the export to csv behavior. At the moment, we think we can use that endpoint directly and reconstruct the payload as a CSV on the frontend - it'll just mean we specify a page_size large enough to pull back all rows in one shot.
I'm gonna need to remove this max_page_size endpoint to facilitate this approach. We may need to revisit it if this endpoint is too slow or the response too big to come back but for now we'll explore this approach and revisit it if it causes issues.
…igned codes from /codes output. Add filtering on assigned + redeemed statuses (#3705)
for more information, see https://pre-commit.ci
What are the relevant tickets?
https://github.com/mitodl/hq/issues/11375
Description (What does it do?)
search_termargument which is used to search across assigned emails and names or redeemed user emails and names.How can this be tested?
Pagination
Filtering
Additional Info