Commit Graph

43 Commits

Author SHA1 Message Date
Emad Rad
40a4a718c0 chore: fixed typo 2025-03-06 10:46:43 -05:00
KyryloKireiev
258f3fc8a0 fix: [FC-0031] Add limit the number of returned results for mobile_search 2023-11-01 17:07:52 +02:00
Yusuf Musleh
4ad8ba1b41 feat: list courses details by keys
This adds the ability to get a list of detailed courses based on their
keys provided in the newly added `keys` query param in the `GET /courses/v1/courses/`
endpoint.
2023-07-12 17:22:38 +03:00
ALi Raza
0ff7c5b13f feat: Enable Certificate Display Behavior add certificate_available_date in course detail API
feat: Enable Certificate Display Behavior add certificate_available_date in course detail API

fix: reviwed changes, certificate_available_date in Course Detail API but not in Course List API

fix: reviewed changes, certificate available date display condition updated

fix: final reviewed changes

fix: serializer and linting tests

fix: serializer and tests

fix: docstring

fix: docstring and tests

fix: typo and mock call
2023-02-23 22:34:11 +05:00
Syed Muhammad Dawoud Sheraz Ali
d2fd26ee91 feat: the ability to filter active courses in course listing api (#31502)
* feat: the ability to filter active courses in course listing api
2023-01-09 20:37:30 +05:00
J. Victor Martins
6adf45df2f feat: Add permissions filter to list courses API
The new filter, called `permissions`, allows callers to filter courses
per access granted to the specified username.  Callers can now filter
courses per roles, actions, etc.
2021-09-07 14:41:50 -07:00
Usama Sadiq
afa102e125 refactor: ran pyupgrade on lms/djangoapps/course_api (#26735) 2021-03-09 12:54:42 +05:00
Jawayria
e9b167e1fd Applied pylint-amnesty to course_api 2021-02-04 13:22:45 +05:00
Troy Sankey
7d3631a79b Add even more telemetry to the CourseIdListView
This time, we narrow our search down to paginate_queryset().
2020-09-23 14:12:53 -04:00
Troy Sankey
23b76a60b6 Add more monitoring to the CourseIdList view 2020-09-22 20:15:34 -04:00
Troy Sankey
98b19dd125 Add some tracing to the CourseListView endpoint 2020-09-18 18:28:00 -04:00
adeelehsan
98cc0b24db Fixed pagination.
Before getting data validate the page number
on the current number of pages
2020-03-11 10:04:04 +05:00
Robert Raposa
9fa5443379 add course_ids api
Adds a course_ids api that can filter by user role, since the courses
api could not perform well enough for this, and returned much more
data than we need.

Additionally, adds a LazyPageNumberPagination to provide more accurate
counts in the pagination response when using LazySequence with the
queryset.

BOM-897
2020-01-31 18:02:16 -05:00
Feanil Patel
79d097d3c8 Remove the role parameter from the courses api.
BOM-1228

The api is already not very performant and trying to limit it to only
show courses where you are staff causes the code to iterate over almost
all the courses and times out before it returns any results to the user.

The plan is to build a different api for the thing we need that will
just provide the course IDs for courses where you are staff and sholud
be much faster.
2020-01-29 16:38:19 -05:00
Dave St.Germain
1aa8c9c53d Add a new courseware API Django app to support the courseware micro-frontend. 2020-01-28 14:59:07 -05:00
Robert Raposa
26d4cc6596 add newrelic metrics and trace details
Add newrelic metrics and trace details to determine performance issue
in CourseListView.

BOM-897
2020-01-28 12:44:11 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Julia Eskew
a2dac21843 Add optional role parameter to course API endpoint. (#21059)
* Add optional role parameter to course API endpoint.

* fixup! Add optional role parameter to course API endpoint.
2019-08-02 12:52:30 -04:00
Amit
a1b5f6fe73 INCR-431: Updates on Python 3.x (#21056) 2019-07-11 10:47:15 -04:00
Calen Pennington
6c596f7c49 Allow courses api to return data incrementally
Prior to this commit, the course api (/api/courses/v1/courses/)
performed all the work necessary to return all courses available
to the user, and then only actually returned on page's worth of those
courses.

With this change, the api now does the work incrementally, computing
only the data needed to fetch the courses up to and including the page
being returned. This still increases approximately linearly as
the page number accessed being increases, but should be more cache-friendly.
One side effect of this is that the max_page reported by pagination
will be an overestimate (it will include pages that are removed due
to a users access restrictions).

This change also changes the sort-order of courses being returned by the
course_api. By sorting by course-id, rather than course-number, we
can sort in the database, rather than in Python, and defer loading data
from the end of the list until it is requested.

REVMI-90
2019-02-06 10:11:15 -05:00
Calen Pennington
805f32a357 Revert "Allow courses api to return data incrementally" 2019-01-25 12:56:57 -05:00
Calen Pennington
a3541d6e46 Allow courses api to return data incrementally
Prior to this commit, the course api (/api/courses/v1/courses/)
performed all the work necessary to return all courses available
to the user, and then only actually returned on page's worth of those
courses.

With this change, the api now does the work incrementally, computing
only the data needed to fetch the courses up to and including the page
being returned. This still increases approximately linearly as
the page number accessed being increases, but should be more cache-friendly.
One side effect of this is that the max_page reported by pagination
will be an overestimate (it will include pages that are removed due
to a users access restrictions).

This change also changes the sort-order of courses being returned by the
course_api. By sorting by course-id, rather than course-number, we
can sort in the database, rather than in Python, and defer loading data
from the end of the list until it is requested.

REVMI-90
2019-01-25 10:30:09 -05:00
Ned Batchelder
59d78031d8 Fix trailing-comma-tuple warnings 2018-11-02 11:06:59 -04:00
christopher lee
939c7f4857 Set max page size for get courses 2018-06-19 15:39:50 -04:00
christopher lee
48b5485be1 Set max page size for get courses
LEARNER-5566
2018-06-19 13:07:04 -04:00
Waheed Ahmed
780c1d982d Rate limit course list API.
This endpoint is likely being inefficient with how it's querying various parts
of the code and can take courseware down, it needs to be rate limited until
optimized.

LEARNER-5527
2018-06-13 16:59:32 +05:00
Albert (AJ) St. Aubin
e3c84bc8de Revert "Rate limit course list API." 2018-06-12 12:06:51 -04:00
Waheed Ahmed
803a6c742c Rate limit course list API.
This endpoint is likely being inefficient with how it's querying various parts of the code
and can take courseware down, it needs to be rate limited until optimized.

LEARNER-5527
2018-06-12 14:58:12 +05:00
Albert (AJ) St. Aubin
7c6c2a1664 Merge pull request #16757 from appsembler/omar/search-for-courses-api
Add search for courses API to allow building a mobile native search view
2018-03-26 07:31:36 -04:00
Omar Al-Ithawi
fc7f98362d Add search for courses API 2018-02-17 17:23:05 +02:00
George Babey
26bac9f611 Moved paginators to edx_rest_framework_extensions package
Pagination should be standard and easy to adopt so moved the paginators
into the edx_rest_framework_extensions package so they can be easily
installed into other app/projects
2018-02-16 09:46:01 -05:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Carol Tong
a1394e9945 Add documentation for Courses API 2016-05-06 15:40:21 -04:00
Clinton Blackburn
1185fff1ec Added pacing field Course API
ECOM-3994
2016-03-30 14:36:43 -04:00
Nimisha Asthagiri
a00c2a7c47 Course API: Change field name from course_id to id 2015-12-28 16:24:54 -05:00
Nimisha Asthagiri
3d84e29218 Update Course Catalog API to include About Overview field. 2015-12-28 15:03:22 -05:00
Nimisha Asthagiri
8e3f4e058d Update Course Catalog API to support filters 2015-12-23 12:31:31 -05:00
Renzo Lucioni
2cee39d535 Modify Course API to filter visible courses by org
Org to filter by is provided to the Course API list view using a querystring argument. Filtering ultimately occurs at the database layer. ECOM-2761.
2015-12-14 15:32:46 -05:00
Nimisha Asthagiri
bb53c03e24 Optimize Course Catalog/About API with Course Overviews 2015-12-10 17:15:42 -05:00
J. Cliff Dyer
f53de2c04a Paginate results of Courses API list endpoint
* Catalog results are now paginated
* Implements the new namespaced pagination described at
  https://openedx.atlassian.net/wiki/pages/viewpage.action?pageId=47481813
* API level code returns pythonic business objects
* View layer performs serialize at the view layer
* Convert views to use DRF generic views
* Removes an unintentional authentication decorator that caused
  the detail endpoint to return a 401 for anonymous users

MA-1724
2015-12-01 08:13:18 -05:00
Michael Frey
29b6ccf5e4 Added new Course List API. 2015-11-24 15:54:03 +00:00
Nimisha Asthagiri
00e9237153 Course Blocks API 2015-11-05 22:30:44 +00:00