Merge pull request #21473 from edx/jdmulloy/refactor_csmh_bigint

Refactor CSME id, CSMH_EXTENDED default true
This commit is contained in:
Joseph Mulloy
2019-08-27 15:15:13 -06:00
committed by GitHub
8 changed files with 11 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
"""
Custom fields for use in the coursewarehistoryextended django app.
Custom fields
"""
from __future__ import absolute_import

View File

@@ -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)

View File

@@ -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={

View File

@@ -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):

View File

@@ -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)),

View File

@@ -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')),

View File

@@ -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):

View File

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