-
Notifications
You must be signed in to change notification settings - Fork 0
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: course details and course statuses APIs #6
Conversation
9d60241
to
649888c
Compare
649888c
to
9810839
Compare
e437a66
to
6e63620
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.
@shadinaif please remove or change the active_count
to something else. It's the same as enrolled_count
.
enrolled_count=Count(Subquery( | ||
CourseEnrollment.objects.filter( | ||
course_id=OuterRef('id'), | ||
is_active=True, | ||
).values('id') | ||
)) | ||
).annotate( | ||
active_count=Count(Subquery( | ||
CourseEnrollment.objects.filter( | ||
course_id=OuterRef('id'), | ||
is_active=True, | ||
).values('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.
@shadinaif this is the same result, but with a different name.
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.
it's the same because the data is not available right now. We'll get it from Clickhouse in another PR. Related issue created
63fe821
to
365cbb0
Compare
141ca1d
to
2a161ca
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.
Thanks a ton @shadinaif!!
I think this pull request has a bug.
|
||
|
||
class CourseRatingsView(APIView): | ||
"""View to get the course ratings""" |
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.
This says "course ratings" 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.
naming mistake
|
||
def get(self, request, *args, **kwargs): | ||
""" | ||
GET /api/fx/statistics/v1/course_ratings/?tenant_ids=<tenantIds> |
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.
Same 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.
same mistake
1e8c7f4
to
a5b1fdd
Compare
still haven't finished reviewing it, will try to do that do by tomorrow morning |
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.
Works! Thanks a ton @shadinaif! Let's merge this and ship it to production!
@shadinaif this has been deployed to production. Should we merge it? |
Fixes:
New:
Course Details
Examples:
The first page of the list of courses for all accessible tenants
The first page of the list of courses for all accessible tenants, sorted by enrolled_count descending then display_name ascending
The second page of the list of courses for all accessible tenants, for those having Sh in the display name or code
Course Statuses
Total number of courses per status of course. There are six possible statuses, which are a composition of enrollment type (instructor-paced and self-paced) with status (ongoing, archived, and upcoming):
ongoing
: instructor-paced courses that have started but not ended yetarchived
: instructor-paced courses that have endedupcoming
: instructor-paced courses that have not started yetself_ongoing
: self-paced courses that have started but not ended yetself_archived
: self-paced courses that have endedself_upcoming
: self-paced courses that have not started yet<tenantIds>
(optional): a comma-separated list of the tenant IDs to get the information for. If not provided, the API will assume the list of all accessible tenants by the userExamples:
Courses count in all accessible tenants
Courses count in tenants 1, 4, and 99