-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add get_collections api #214
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
feat: add get_collections api #214
Conversation
|
Thanks for the pull request, @navinkarkera! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
5f128ce to
fc598eb
Compare
fc598eb to
67d6b97
Compare
rpenido
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navinkarkera Could you add a test for this new function?
4b2b92d to
9b941cd
Compare
allow users to get enabled & disabled collections together
9b941cd to
005f616
Compare
0420cb7 to
2a0bc53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thank you for your work, @navinkarkera !
- I tested this using the instructions from openedx/edx-platform#35324
- I read through the code
-
I checked for accessibility issues - Includes documentation
@pomegranited This is ready for CC review!
pomegranited
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navinkarkera 👍 with one nit/question for @ormsbee , but I'm fine with merging this as-is.
- I tested this using the instructions on openedx/edx-platform#35324
- I read through the code
-
I checked for accessibility issuesN/A - Includes documentation
-
User-facing strings are extracted for translationN/A
| """ | ||
| Get all collections, optionally caller can filter by enabled flag | ||
| """ | ||
| qs = Collection.objects.all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_components api method sorts its returned results by pk.. should we be doing that here too? It's nice to have APIs return things in a deterministic order (and it makes your tests simpler too).
I can't find an ADR which supports this stance though.. @ormsbee what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I guess if we sort these results, we should sort those from get_learning_package_collections too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pomegranited I agree about making tests simpler, as you can see I had to make use of self.assertQuerySetEqual as the order was not matching in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR to order by pk, we can remove the commit if @ormsbee does not agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally made it sort by pk as a cheap, lazy way of sorting it by creation time. But I think it's a reasonable default sort in a lot of situations, so this is fine by me.
|
@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Adds
get_collectionsapi for openedx/edx-platform#35324