Files
edx-platform/openedx/core/djangoapps/schedules/models.py
Clinton Blackburn 526564c9a4 Added indices to the Schedule model
These new indices will allow for more efficient querying of schedules.
2017-08-16 15:32:37 -04:00

26 lines
812 B
Python

from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.models import TimeStampedModel
class Schedule(TimeStampedModel):
enrollment = models.OneToOneField('student.CourseEnrollment', null=False)
active = models.BooleanField(
default=True,
help_text=_('Indicates if this schedule is actively used')
)
start = models.DateTimeField(
db_index=True,
help_text=_('Date this schedule went into effect')
)
upgrade_deadline = models.DateTimeField(
blank=True,
db_index=True,
null=True,
help_text=_('Deadline by which the learner must upgrade to a verified seat')
)
class Meta(object):
verbose_name = _('Schedule')
verbose_name_plural = _('Schedules')