-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added missing fields to Person and CourseRun Search API #94
Conversation
return [{ | ||
'id': area_of_expertise.id, | ||
'value': area_of_expertise.value, | ||
} for area_of_expertise in sorted(result.object.areas_of_expertise.all(), key=attrgetter('id'))] |
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.
We can break this logic. Maybe into multiple lines for better understanding. One possible sol. can be. Better to order_by it, if it's a DB query.
areas = result.object.areas_of_expertise.all()
sorted_areas = sorted(areas, key=attrgetter('id'))
return [{'id': area.id, 'value': area.value} for area in sorted_areas]
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.
Do we need to sort here?
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.
Broke down the logic in new commit. We need sort here because the response needs to be in order. Avoided using order_by to make additional calls to DB
e2f510f
to
b55af59
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
This PR adds the following missing fields in the
course_runs
andpeople
search apis.course_run:
people:
Testing details:
Curl the following api endpoints to verify the changes
course_run:
people: