-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
E0d/refactor 0002 inter app apis #31547
base: master
Are you sure you want to change the base?
Conversation
90c3d58
to
a20cd56
Compare
Nice, I'll take a look soon. |
Sorry, Ed. Busy on-call week. This is still on my radar. |
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.
Looks good, just one formatting request. Out out of curiosity, do you have a sense why @tuchfarber originally split it into api.py and models_api.py? Seems as if he was following the same ADR that you were.
from common.djangoapps.student.models import CourseEnrollment as _CourseEnrollment, UserProfile as _UserProfile, \ | ||
CourseAccessRole as _CourseAccessRole, PendingNameChange as _PendingNameChange, \ | ||
ManualEnrollmentAudit as _ManualEnrollmentAudit |
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 prevailing style in edx-platform is to have one import .... as ....
per line, preferring parentheses to backslashes. The from common.djangoapps.student.models import (...
on the next line is a good example.
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.
Looks like we have docs on this, albeit old ones: https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/style_guides/python-guidelines.html#breaking-long-lines
I borrowed that pattern from #20354 at the time. Though I can say I didn't super understand the benefit of it. It felt superfluous which is why I didn't add it to the OEP https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0049-django-app-patterns.html |
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.
Oh hi @tuchfarber ! Hope you're doing well. Thanks for the background.
@e0d Besides my import style nit above, I think your refactor looks good. I would use a refactor:
commit rather than a chore:
commit. Otherwise, 🚀
Thanks for the pull request, @e0d! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
1 similar comment
Thanks for the pull request, @e0d! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
@feanil since you are leading the API work, is this worth merging? |
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.
Yes, I think this move towards our current standards id definitely worth landing.
@e0d This seems like a nice PR and has two thumbs up - can we get it rebased and merged? |
Hey @e0d, is this PR still needed or should we close it? |
This is PR refactors code in the lms/student Django app toward the standards agreed to:
In short the functions in models_api.py have been migrated to api.py and references haven been updated to use api.py.