Commit Graph

13 Commits

Author SHA1 Message Date
Chris Pappas
4c9af183cb ENT-2294 | Moving utility functions in program enrollments to places … (#21752)
* ENT-2294 | Moving utility functions in program enrollments to places related to the data they manipulate

* updating a mock path

* minor test fix
2019-09-24 10:07:38 -04: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
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Sanford Student
6490551f1b MA-2103 2016-03-08 16:17:01 -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