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
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
Django 2.0 will make this field required for `ForeignKey` and `OneToOneFields`.
In previous versions the option defaulted to `models.CASCADE` when not
specified. This change should make the deprecation warnings in the current
Django version go away.
The migrations where also modified, but the changes should not cause a change in
the database schema since `models.CASCADE` was already the old default.
Prior to this commit, any apps that update their data when courses are
published had to create their own management commands for bootstrapping
or error recovery (e.g. generate_course_overviews,
generate_course_blocks). This is a management command to allow us to
generically simulate a course_publish signal so that any async tasks
that trigger actions off of that can do so without having to each write
their own management commands.
It has a few options to make it more ops friendly:
* Can specify a set of courses, but defaults to all courses in the
modulestore.
* Can specify a set of listeners, so we can bootstrap a new app without
rebuilding everything.
* Can specify a delay between emitting signals so that we don't flood
the queues and block author-initiated publishes from going through in
a timely manner.
* Dry-run mode for a simple preview of what the script will attempt.
Prior to this change, providing any student_view_data querystring would result
in student_view_data returned for all XBlock types.
Updates Course Blocks API tests to verify.