diff --git a/lms/djangoapps/coursewarehistoryextended/fields.py b/lms/djangoapps/courseware/fields.py similarity index 97% rename from lms/djangoapps/coursewarehistoryextended/fields.py rename to lms/djangoapps/courseware/fields.py index 9b1aeb6d7e..adb2620798 100644 --- a/lms/djangoapps/coursewarehistoryextended/fields.py +++ b/lms/djangoapps/courseware/fields.py @@ -1,5 +1,5 @@ """ -Custom fields for use in the coursewarehistoryextended django app. +Custom fields """ from __future__ import absolute_import diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index 1b7edb43a6..cbf99df437 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -94,6 +94,7 @@ class StudentModule(models.Model): ('chapter', 'Section'), ('sequential', 'Subsection'), ('library_content', 'Library Content')) + ## These three are the key for the object module_type = models.CharField(max_length=32, choices=MODULE_TYPES, default='problem', db_index=True) diff --git a/lms/djangoapps/coursewarehistoryextended/migrations/0001_initial.py b/lms/djangoapps/coursewarehistoryextended/migrations/0001_initial.py index 7615fb4764..851584fbec 100644 --- a/lms/djangoapps/coursewarehistoryextended/migrations/0001_initial.py +++ b/lms/djangoapps/coursewarehistoryextended/migrations/0001_initial.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from __future__ import absolute_import from django.db import migrations, models import django.db.models.deletion -import coursewarehistoryextended.fields +from courseware.fields import UnsignedBigIntAutoField from django.conf import settings def bump_pk_start(apps, schema_editor): @@ -47,7 +47,7 @@ class Migration(migrations.Migration): ('state', models.TextField(null=True, blank=True)), ('grade', models.FloatField(null=True, blank=True)), ('max_grade', models.FloatField(null=True, blank=True)), - ('id', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=True)), + ('id', UnsignedBigIntAutoField(serialize=False, primary_key=True)), ('student_module', models.ForeignKey(to='courseware.StudentModule', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False)), ], options={ diff --git a/lms/djangoapps/coursewarehistoryextended/models.py b/lms/djangoapps/coursewarehistoryextended/models.py index aa6cba7cdc..9df1277c48 100644 --- a/lms/djangoapps/coursewarehistoryextended/models.py +++ b/lms/djangoapps/coursewarehistoryextended/models.py @@ -20,7 +20,7 @@ from django.db.models.signals import post_delete, post_save from django.dispatch import receiver from courseware.models import BaseStudentModuleHistory, StudentModule -from coursewarehistoryextended.fields import UnsignedBigIntAutoField +from courseware.fields import UnsignedBigIntAutoField class StudentModuleHistoryExtended(BaseStudentModuleHistory): diff --git a/lms/djangoapps/grades/migrations/0001_initial.py b/lms/djangoapps/grades/migrations/0001_initial.py index 81157bffde..47842aa377 100644 --- a/lms/djangoapps/grades/migrations/0001_initial.py +++ b/lms/djangoapps/grades/migrations/0001_initial.py @@ -6,7 +6,7 @@ import model_utils.fields from django.db import migrations, models from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField -import coursewarehistoryextended.fields +from courseware.fields import UnsignedBigIntAutoField class Migration(migrations.Migration): @@ -20,7 +20,7 @@ class Migration(migrations.Migration): fields=[ ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), - ('id', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=True)), + ('id', UnsignedBigIntAutoField(serialize=False, primary_key=True)), ('user_id', models.IntegerField()), ('course_id', CourseKeyField(max_length=255)), ('usage_key', UsageKeyField(max_length=255)), diff --git a/lms/djangoapps/grades/migrations/0006_persistent_course_grades.py b/lms/djangoapps/grades/migrations/0006_persistent_course_grades.py index b8a96efbcb..0ea85675d6 100644 --- a/lms/djangoapps/grades/migrations/0006_persistent_course_grades.py +++ b/lms/djangoapps/grades/migrations/0006_persistent_course_grades.py @@ -6,7 +6,7 @@ import model_utils.fields from django.db import migrations, models from opaque_keys.edx.django.models import CourseKeyField -import coursewarehistoryextended.fields +from courseware.fields import UnsignedBigIntAutoField class Migration(migrations.Migration): @@ -21,7 +21,7 @@ class Migration(migrations.Migration): fields=[ ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), - ('id', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=True)), + ('id', UnsignedBigIntAutoField(serialize=False, primary_key=True)), ('user_id', models.IntegerField(db_index=True)), ('course_id', CourseKeyField(max_length=255)), ('course_edited_timestamp', models.DateTimeField(verbose_name='Last content edit timestamp')), diff --git a/lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py b/lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py index 8ac6c4de7a..28f5ed61e0 100644 --- a/lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py +++ b/lms/djangoapps/grades/migrations/0013_persistentsubsectiongradeoverride.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals from django.db import migrations, models -from coursewarehistoryextended.fields import UnsignedBigIntOneToOneField +from courseware.fields import UnsignedBigIntOneToOneField class Migration(migrations.Migration): diff --git a/lms/djangoapps/grades/models.py b/lms/djangoapps/grades/models.py index 7644334655..d415261e28 100644 --- a/lms/djangoapps/grades/models.py +++ b/lms/djangoapps/grades/models.py @@ -28,7 +28,7 @@ from opaque_keys.edx.keys import CourseKey, UsageKey from simple_history.models import HistoricalRecords from six.moves import map -from coursewarehistoryextended.fields import UnsignedBigIntAutoField, UnsignedBigIntOneToOneField +from courseware.fields import UnsignedBigIntAutoField, UnsignedBigIntOneToOneField from lms.djangoapps.grades import constants, events from openedx.core.lib.cache_utils import get_cache