lms.djangoapps.course_home_api package

Contents

lms.djangoapps.course_home_api package#

Subpackages#

Submodules#

lms.djangoapps.course_home_api.apps module#

Course home api application configuration

class lms.djangoapps.course_home_api.apps.CourseHomeApiConfig(app_name, app_module)#

Bases: AppConfig

name = 'lms.djangoapps.course_home_api'#

lms.djangoapps.course_home_api.models module#

Course home api models file

class lms.djangoapps.course_home_api.models.DisableProgressPageStackedConfig(*args, **kwargs)#

Bases: StackedConfigurationModel

Stacked Config Model for disabling the frontend-app-learning progress page

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

STACKABLE_FIELDS = ('disabled',)#
change_date#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

changed_by#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

changed_by_id#
course#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

course_id#
disabled#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_change_date(*, field=<django.db.models.fields.DateTimeField: change_date>, is_next=True, **kwargs)#
get_previous_by_change_date(*, field=<django.db.models.fields.DateTimeField: change_date>, is_next=False, **kwargs)#
id#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

org#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

org_course#

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

site#

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

site_id#

lms.djangoapps.course_home_api.serializers module#

Course Home Serializers.

class lms.djangoapps.course_home_api.serializers.DatesBannerSerializer(*args, **kwargs)#

Bases: ReadOnlySerializer

Serializer Mixin for displaying the dates banner. Can be added to any serializer who’s tab wants to display it.

get_dates_banner_info(_)#

Serializer mixin for returning date banner info. Gets its input from the views course_key_string url parameter and the request’s user object.

class lms.djangoapps.course_home_api.serializers.ReadOnlySerializer(*args, **kwargs)#

Bases: Serializer

Serializers have an abstract create & update, but we often don’t need them. So this silences the linter.

create(validated_data)#
update(instance, validated_data)#
class lms.djangoapps.course_home_api.serializers.VerifiedModeSerializer(*args, **kwargs)#

Bases: ReadOnlySerializer

Serializer Mixin for displaying verified mode upgrade information.

Requires ‘course_overview’, ‘enrollment’, and ‘request’ from self.context.

get_verified_mode(_)#

Return verified mode information, or None.

lms.djangoapps.course_home_api.tasks module#

Celery tasks used by the course_home_api app.

lms.djangoapps.course_home_api.toggles module#

Toggles for course home experience.

lms.djangoapps.course_home_api.toggles.course_home_mfe_progress_tab_is_active(course_key)#
lms.djangoapps.course_home_api.toggles.new_discussion_sidebar_view_is_enabled(course_key)#

Returns True if the new discussion sidebar view is enabled for the given course.

lms.djangoapps.course_home_api.toggles.send_course_progress_analytics_for_student_is_enabled(course_key)#

Returns True if the course completion analytics feature is enabled for a given course.

lms.djangoapps.course_home_api.urls module#

Contains all the URLs for the Course Home

lms.djangoapps.course_home_api.utils module#

Utilities for views in the course home api

lms.djangoapps.course_home_api.utils.get_course_or_403(*args, **kwargs)#

When we make requests to the various Learner Home API endpoints, we do not want to return the actual redirects, Instead we should return an error code. The redirect info is returned from the course metadata endpoint and the URL can be followed by whatever client is calling.

Raises:
  • - 404 if course is not found

  • - 403 if the requesting user does not have access to the course

Module contents#