openedx.core.djangoapps.course_date_signals package#

Submodules#

openedx.core.djangoapps.course_date_signals.apps module#

Django App Configuration for the course_date_signals app

class openedx.core.djangoapps.course_date_signals.apps.CourseDatesSignalsConfig(app_name, app_module)#

Bases: AppConfig

name = 'openedx.core.djangoapps.course_date_signals'#
ready()#

Connect handlers to signals.

openedx.core.djangoapps.course_date_signals.handlers module#

Signal handlers for writing course dates into edx_when.

openedx.core.djangoapps.course_date_signals.handlers.extract_dates(sender, course_key, **kwargs)#

Extract dates from blocks when publishing a course.

openedx.core.djangoapps.course_date_signals.handlers.extract_dates_from_course(course)#

Extract all dates from the supplied course.

openedx.core.djangoapps.course_date_signals.models module#

Models for configuration course_date_signals

SelfPacedRelativeDatesConfig:

manage which orgs/courses/course runs have self-paced relative dates enabled

class openedx.core.djangoapps.course_date_signals.models.SelfPacedRelativeDatesConfig(*args, **kwargs)#

Bases: StackedConfigurationModel

Configuration to manage the SelfPacedRelativeDates settings.

exception DoesNotExist#

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned#

Bases: MultipleObjectsReturned

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#
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#

openedx.core.djangoapps.course_date_signals.utils module#

Utility functions around course dates.

get_expected_duration: return the expected duration of a course (absent any user information)

openedx.core.djangoapps.course_date_signals.utils.get_expected_duration(course_id)#

Return a datetime.timedelta defining the expected length of the supplied course.

openedx.core.djangoapps.course_date_signals.utils.spaced_out_sections(course)#

Generator that returns sections of the course block with a suggested time to complete for each

Returns:

index of section section (block): a section block of the course relative time (timedelta): the amount of weeks to complete the section, since start of course

Return type:

index (int)

Module contents#

Django app to manage course content dates, and ingesting them into edx-when for later use by the LMS.