Commit b27f8a29 by John Eskew Committed by GitHub

Merge pull request #13671 from edx/jeskew/move_xmodule_django_to_openedx_core

Move xmodule_django app to openedx.core.djangoapps
parents aae9f9cc 3614eb28
...@@ -4,7 +4,7 @@ from __future__ import unicode_literals ...@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -20,12 +20,12 @@ class Migration(migrations.Migration): ...@@ -20,12 +20,12 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created_time', models.DateTimeField(auto_now_add=True)), ('created_time', models.DateTimeField(auto_now_add=True)),
('updated_time', models.DateTimeField(auto_now=True)), ('updated_time', models.DateTimeField(auto_now=True)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
('action', models.CharField(max_length=100, db_index=True)), ('action', models.CharField(max_length=100, db_index=True)),
('state', models.CharField(max_length=50)), ('state', models.CharField(max_length=50)),
('should_display', models.BooleanField(default=False)), ('should_display', models.BooleanField(default=False)),
('message', models.CharField(max_length=1000)), ('message', models.CharField(max_length=1000)),
('source_course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('source_course_key', CourseKeyField(max_length=255, db_index=True)),
('display_name', models.CharField(default=b'', max_length=255, blank=True)), ('display_name', models.CharField(default=b'', max_length=255, blank=True)),
('created_user', models.ForeignKey(related_name='created_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), ('created_user', models.ForeignKey(related_name='created_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)),
('updated_user', models.ForeignKey(related_name='updated_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), ('updated_user', models.ForeignKey(related_name='updated_by_user+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)),
......
...@@ -11,7 +11,7 @@ file and check it in at the same time as your model changes. To do that, ...@@ -11,7 +11,7 @@ file and check it in at the same time as your model changes. To do that,
""" """
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db import models from django.db import models
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from course_action_state.managers import CourseActionStateManager, CourseRerunUIStateManager from course_action_state.managers import CourseActionStateManager, CourseRerunUIStateManager
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -15,7 +15,7 @@ class Migration(migrations.Migration): ...@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
name='CourseMode', name='CourseMode',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, verbose_name='Course', db_index=True)), ('course_id', CourseKeyField(max_length=255, verbose_name='Course', db_index=True)),
('mode_slug', models.CharField(max_length=100, verbose_name='Mode')), ('mode_slug', models.CharField(max_length=100, verbose_name='Mode')),
('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')), ('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')),
('min_price', models.IntegerField(default=0, verbose_name='Price')), ('min_price', models.IntegerField(default=0, verbose_name='Price')),
...@@ -31,7 +31,7 @@ class Migration(migrations.Migration): ...@@ -31,7 +31,7 @@ class Migration(migrations.Migration):
name='CourseModesArchive', name='CourseModesArchive',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('mode_slug', models.CharField(max_length=100)), ('mode_slug', models.CharField(max_length=100)),
('mode_display_name', models.CharField(max_length=255)), ('mode_display_name', models.CharField(max_length=255)),
('min_price', models.IntegerField(default=0)), ('min_price', models.IntegerField(default=0)),
......
...@@ -10,7 +10,7 @@ from django.core.exceptions import ValidationError ...@@ -10,7 +10,7 @@ from django.core.exceptions import ValidationError
from django.db import models from django.db import models
from django.db.models import Q from django.db.models import Q
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
Mode = namedtuple('Mode', Mode = namedtuple('Mode',
[ [
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -27,7 +27,7 @@ class Migration(migrations.Migration): ...@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=30)), ('name', models.CharField(max_length=30)),
('course_id', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), ('course_id', CourseKeyField(db_index=True, max_length=255, blank=True)),
('users', models.ManyToManyField(related_name='roles', to=settings.AUTH_USER_MODEL)), ('users', models.ManyToManyField(related_name='roles', to=settings.AUTH_USER_MODEL)),
], ],
options={ options={
......
...@@ -12,7 +12,7 @@ from student.models import CourseEnrollment ...@@ -12,7 +12,7 @@ from student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule_django.models import CourseKeyField, NoneToEmptyManager from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, NoneToEmptyManager
FORUM_ROLE_ADMINISTRATOR = ugettext_noop('Administrator') FORUM_ROLE_ADMINISTRATOR = ugettext_noop('Administrator')
FORUM_ROLE_MODERATOR = ugettext_noop('Moderator') FORUM_ROLE_MODERATOR = ugettext_noop('Moderator')
......
...@@ -5,7 +5,7 @@ from django.db import migrations, models ...@@ -5,7 +5,7 @@ from django.db import migrations, models
import django_countries.fields import django_countries.fields
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -38,7 +38,7 @@ class Migration(migrations.Migration): ...@@ -38,7 +38,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)), ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
('snapshot', models.TextField(null=True, blank=True)), ('snapshot', models.TextField(null=True, blank=True)),
], ],
options={ options={
...@@ -49,7 +49,7 @@ class Migration(migrations.Migration): ...@@ -49,7 +49,7 @@ class Migration(migrations.Migration):
name='EmbargoedCourse', name='EmbargoedCourse',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), ('course_id', CourseKeyField(unique=True, max_length=255, db_index=True)),
('embargoed', models.BooleanField(default=False)), ('embargoed', models.BooleanField(default=False)),
], ],
), ),
...@@ -86,7 +86,7 @@ class Migration(migrations.Migration): ...@@ -86,7 +86,7 @@ class Migration(migrations.Migration):
name='RestrictedCourse', name='RestrictedCourse',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', xmodule_django.models.CourseKeyField(help_text='The course key for the restricted course.', unique=True, max_length=255, db_index=True)), ('course_key', CourseKeyField(help_text='The course key for the restricted course.', unique=True, max_length=255, db_index=True)),
('enroll_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from enrollment.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])), ('enroll_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from enrollment.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])),
('access_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from accessing a course.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])), ('access_msg_key', models.CharField(default=b'default', help_text='The message to show when a user is blocked from accessing a course.', max_length=255, choices=[(b'default', b'Default'), (b'embargo', b'Embargo')])),
('disable_access_check', models.BooleanField(default=False, help_text='Allow users who enrolled in an allowed country to access restricted courses from excluded countries.')), ('disable_access_check', models.BooleanField(default=False, help_text='Allow users who enrolled in an allowed country to access restricted courses from excluded countries.')),
......
...@@ -25,7 +25,7 @@ from django_countries.fields import CountryField ...@@ -25,7 +25,7 @@ from django_countries.fields import CountryField
from django_countries import countries from django_countries import countries
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from xmodule_django.models import CourseKeyField, NoneToEmptyManager from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, NoneToEmptyManager
from embargo.exceptions import InvalidAccessPoint from embargo.exceptions import InvalidAccessPoint
from embargo.messages import ENROLL_MESSAGES, COURSEWARE_MESSAGES from embargo.messages import ENROLL_MESSAGES, COURSEWARE_MESSAGES
......
...@@ -4,7 +4,7 @@ from __future__ import unicode_literals ...@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -18,7 +18,7 @@ class Migration(migrations.Migration): ...@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
name='CourseMessage', name='CourseMessage',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), ('course_key', CourseKeyField(db_index=True, max_length=255, blank=True)),
('message', models.TextField(null=True, blank=True)), ('message', models.TextField(null=True, blank=True)),
], ],
), ),
......
...@@ -6,7 +6,7 @@ from django.db import models ...@@ -6,7 +6,7 @@ from django.db import models
from django.contrib import admin from django.contrib import admin
from django.core.cache import cache from django.core.cache import cache
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from config_models.admin import ConfigurationModelAdmin from config_models.admin import ConfigurationModelAdmin
......
...@@ -6,7 +6,7 @@ import django.utils.timezone ...@@ -6,7 +6,7 @@ import django.utils.timezone
import django_countries.fields import django_countries.fields
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -21,7 +21,7 @@ class Migration(migrations.Migration): ...@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('anonymous_user_id', models.CharField(unique=True, max_length=32)), ('anonymous_user_id', models.CharField(unique=True, max_length=32)),
('course_id', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), ('course_id', CourseKeyField(db_index=True, max_length=255, blank=True)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
], ],
), ),
...@@ -30,7 +30,7 @@ class Migration(migrations.Migration): ...@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('org', models.CharField(db_index=True, max_length=64, blank=True)), ('org', models.CharField(db_index=True, max_length=64, blank=True)),
('course_id', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, blank=True)), ('course_id', CourseKeyField(db_index=True, max_length=255, blank=True)),
('role', models.CharField(max_length=64, db_index=True)), ('role', models.CharField(max_length=64, db_index=True)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
], ],
...@@ -39,7 +39,7 @@ class Migration(migrations.Migration): ...@@ -39,7 +39,7 @@ class Migration(migrations.Migration):
name='CourseEnrollment', name='CourseEnrollment',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)),
('is_active', models.BooleanField(default=True)), ('is_active', models.BooleanField(default=True)),
('mode', models.CharField(default=b'honor', max_length=100)), ('mode', models.CharField(default=b'honor', max_length=100)),
...@@ -54,7 +54,7 @@ class Migration(migrations.Migration): ...@@ -54,7 +54,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('email', models.CharField(max_length=255, db_index=True)), ('email', models.CharField(max_length=255, db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('auto_enroll', models.BooleanField(default=0)), ('auto_enroll', models.BooleanField(default=0)),
('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)),
], ],
...@@ -101,7 +101,7 @@ class Migration(migrations.Migration): ...@@ -101,7 +101,7 @@ class Migration(migrations.Migration):
name='EntranceExamConfiguration', name='EntranceExamConfiguration',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)),
('updated', models.DateTimeField(auto_now=True, db_index=True)), ('updated', models.DateTimeField(auto_now=True, db_index=True)),
('skip_entrance_exam', models.BooleanField(default=True)), ('skip_entrance_exam', models.BooleanField(default=True)),
...@@ -112,7 +112,7 @@ class Migration(migrations.Migration): ...@@ -112,7 +112,7 @@ class Migration(migrations.Migration):
name='HistoricalCourseEnrollment', name='HistoricalCourseEnrollment',
fields=[ fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created', models.DateTimeField(db_index=True, null=True, editable=False, blank=True)), ('created', models.DateTimeField(db_index=True, null=True, editable=False, blank=True)),
('is_active', models.BooleanField(default=True)), ('is_active', models.BooleanField(default=True)),
('mode', models.CharField(default=b'honor', max_length=100)), ('mode', models.CharField(default=b'honor', max_length=100)),
......
...@@ -45,7 +45,7 @@ from opaque_keys.edx.keys import CourseKey ...@@ -45,7 +45,7 @@ from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey
from simple_history.models import HistoricalRecords from simple_history.models import HistoricalRecords
from track import contexts from track import contexts
from xmodule_django.models import CourseKeyField, NoneToEmptyManager from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, NoneToEmptyManager
from lms.djangoapps.badges.utils import badges_enabled from lms.djangoapps.badges.utils import badges_enabled
from certificates.models import GeneratedCertificate from certificates.models import GeneratedCertificate
......
...@@ -9,7 +9,7 @@ from django.contrib.auth.models import User ...@@ -9,7 +9,7 @@ from django.contrib.auth.models import User
import logging import logging
from student.models import CourseAccessRole from student.models import CourseAccessRole
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -11,7 +11,7 @@ from openedx.core.lib.api.authentication import ( ...@@ -11,7 +11,7 @@ from openedx.core.lib.api.authentication import (
OAuth2AuthenticationAllowInactiveUser, OAuth2AuthenticationAllowInactiveUser,
SessionAuthenticationAllowInactiveUser SessionAuthenticationAllowInactiveUser
) )
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from badges.models import BadgeAssertion from badges.models import BadgeAssertion
from .serializers import BadgeAssertionSerializer from .serializers import BadgeAssertionSerializer
......
...@@ -7,7 +7,7 @@ import badges.models ...@@ -7,7 +7,7 @@ import badges.models
from django.conf import settings from django.conf import settings
import django.utils.timezone import django.utils.timezone
from model_utils import fields from model_utils import fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -36,7 +36,7 @@ class Migration(migrations.Migration): ...@@ -36,7 +36,7 @@ class Migration(migrations.Migration):
('slug', models.SlugField(max_length=255, validators=[badges.models.validate_lowercase])), ('slug', models.SlugField(max_length=255, validators=[badges.models.validate_lowercase])),
('issuing_component', models.SlugField(default=b'', blank=True, validators=[badges.models.validate_lowercase])), ('issuing_component', models.SlugField(default=b'', blank=True, validators=[badges.models.validate_lowercase])),
('display_name', models.CharField(max_length=255)), ('display_name', models.CharField(max_length=255)),
('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), ('course_id', CourseKeyField(default=None, max_length=255, blank=True)),
('description', models.TextField()), ('description', models.TextField()),
('criteria', models.TextField()), ('criteria', models.TextField()),
('mode', models.CharField(default=b'', max_length=100, blank=True)), ('mode', models.CharField(default=b'', max_length=100, blank=True)),
......
...@@ -17,7 +17,7 @@ from opaque_keys.edx.keys import CourseKey ...@@ -17,7 +17,7 @@ from opaque_keys.edx.keys import CourseKey
from badges.utils import deserialize_count_specs from badges.utils import deserialize_count_specs
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
def validate_badge_image(image): def validate_badge_image(image):
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -17,7 +17,7 @@ class Migration(migrations.Migration): ...@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
name='CourseAuthorization', name='CourseAuthorization',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), ('course_id', CourseKeyField(unique=True, max_length=255, db_index=True)),
('email_enabled', models.BooleanField(default=False)), ('email_enabled', models.BooleanField(default=False)),
], ],
), ),
...@@ -31,7 +31,7 @@ class Migration(migrations.Migration): ...@@ -31,7 +31,7 @@ class Migration(migrations.Migration):
('text_message', models.TextField(null=True, blank=True)), ('text_message', models.TextField(null=True, blank=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)), ('modified', models.DateTimeField(auto_now=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('to_option', models.CharField(default=b'myself', max_length=64, choices=[(b'myself', b'Myself'), (b'staff', b'Staff and instructors'), (b'all', b'All')])), ('to_option', models.CharField(default=b'myself', max_length=64, choices=[(b'myself', b'Myself'), (b'staff', b'Staff and instructors'), (b'all', b'All')])),
('template_name', models.CharField(max_length=255, null=True)), ('template_name', models.CharField(max_length=255, null=True)),
('from_addr', models.CharField(max_length=255, null=True)), ('from_addr', models.CharField(max_length=255, null=True)),
...@@ -51,7 +51,7 @@ class Migration(migrations.Migration): ...@@ -51,7 +51,7 @@ class Migration(migrations.Migration):
name='Optout', name='Optout',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)),
], ],
), ),
......
...@@ -15,7 +15,7 @@ from openedx.core.lib.mail_utils import wrap_message ...@@ -15,7 +15,7 @@ from openedx.core.lib.mail_utils import wrap_message
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from student.roles import CourseStaffRole, CourseInstructorRole from student.roles import CourseStaffRole, CourseInstructorRole
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from util.keyword_substitution import substitute_keywords_with_data from util.keyword_substitution import substitute_keywords_with_data
from util.query import use_read_replica_if_available from util.query import use_read_replica_if_available
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, LocationKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -17,7 +17,7 @@ class Migration(migrations.Migration): ...@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
name='CcxFieldOverride', name='CcxFieldOverride',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('location', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), ('location', LocationKeyField(max_length=255, db_index=True)),
('field', models.CharField(max_length=255)), ('field', models.CharField(max_length=255)),
('value', models.TextField(default=b'null')), ('value', models.TextField(default=b'null')),
], ],
...@@ -26,7 +26,7 @@ class Migration(migrations.Migration): ...@@ -26,7 +26,7 @@ class Migration(migrations.Migration):
name='CustomCourseForEdX', name='CustomCourseForEdX',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('display_name', models.CharField(max_length=255)), ('display_name', models.CharField(max_length=255)),
('coach', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('coach', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
], ],
......
...@@ -11,7 +11,7 @@ from pytz import utc ...@@ -11,7 +11,7 @@ from pytz import utc
from lazy import lazy from lazy import lazy
from openedx.core.lib.time_zone_utils import get_time_zone_abbr from openedx.core.lib.time_zone_utils import get_time_zone_abbr
from xmodule_django.models import CourseKeyField, LocationKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, LocationKeyField
from xmodule.error_module import ErrorDescriptor from xmodule.error_module import ErrorDescriptor
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
......
...@@ -15,7 +15,7 @@ from opaque_keys.edx.keys import CourseKey ...@@ -15,7 +15,7 @@ from opaque_keys.edx.keys import CourseKey
from branding import api as branding_api from branding import api as branding_api
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from util.organizations_helpers import get_course_organizations from util.organizations_helpers import get_course_organizations
from certificates.models import ( from certificates.models import (
......
...@@ -4,13 +4,13 @@ from __future__ import unicode_literals ...@@ -4,13 +4,13 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import certificates.models import certificates.models
import model_utils.fields import model_utils.fields
import xmodule_django.models
import django_extensions.db.fields import django_extensions.db.fields
import django_extensions.db.fields.json import django_extensions.db.fields.json
import django.db.models.deletion import django.db.models.deletion
import django.utils.timezone import django.utils.timezone
from badges.models import validate_badge_image from badges.models import validate_badge_image
from django.conf import settings from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -24,7 +24,7 @@ class Migration(migrations.Migration): ...@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
name='BadgeAssertion', name='BadgeAssertion',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), ('course_id', CourseKeyField(default=None, max_length=255, blank=True)),
('mode', models.CharField(max_length=100)), ('mode', models.CharField(max_length=100)),
('data', django_extensions.db.fields.json.JSONField()), ('data', django_extensions.db.fields.json.JSONField()),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
...@@ -58,7 +58,7 @@ class Migration(migrations.Migration): ...@@ -58,7 +58,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
('enabled', models.BooleanField(default=False)), ('enabled', models.BooleanField(default=False)),
], ],
options={ options={
...@@ -89,7 +89,7 @@ class Migration(migrations.Migration): ...@@ -89,7 +89,7 @@ class Migration(migrations.Migration):
('description', models.CharField(help_text='Description and/or admin notes.', max_length=255, null=True, blank=True)), ('description', models.CharField(help_text='Description and/or admin notes.', max_length=255, null=True, blank=True)),
('template', models.TextField(help_text='Django template HTML.')), ('template', models.TextField(help_text='Django template HTML.')),
('organization_id', models.IntegerField(help_text='Organization of template.', null=True, db_index=True, blank=True)), ('organization_id', models.IntegerField(help_text='Organization of template.', null=True, db_index=True, blank=True)),
('course_key', xmodule_django.models.CourseKeyField(db_index=True, max_length=255, null=True, blank=True)), ('course_key', CourseKeyField(db_index=True, max_length=255, null=True, blank=True)),
('mode', models.CharField(default=b'honor', choices=[(b'verified', b'verified'), (b'honor', b'honor'), (b'audit', b'audit'), (b'professional', b'professional'), (b'no-id-professional', b'no-id-professional')], max_length=125, blank=True, help_text='The course mode for this template.', null=True)), ('mode', models.CharField(default=b'honor', choices=[(b'verified', b'verified'), (b'honor', b'honor'), (b'audit', b'audit'), (b'professional', b'professional'), (b'no-id-professional', b'no-id-professional')], max_length=125, blank=True, help_text='The course mode for this template.', null=True)),
('is_active', models.BooleanField(default=False, help_text='On/Off switch.')), ('is_active', models.BooleanField(default=False, help_text='On/Off switch.')),
], ],
...@@ -114,7 +114,7 @@ class Migration(migrations.Migration): ...@@ -114,7 +114,7 @@ class Migration(migrations.Migration):
name='CertificateWhitelist', name='CertificateWhitelist',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), ('course_id', CourseKeyField(default=None, max_length=255, blank=True)),
('whitelist', models.BooleanField(default=0)), ('whitelist', models.BooleanField(default=0)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')), ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('notes', models.TextField(default=None, null=True)), ('notes', models.TextField(default=None, null=True)),
...@@ -143,7 +143,7 @@ class Migration(migrations.Migration): ...@@ -143,7 +143,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
], ],
options={ options={
'get_latest_by': 'created', 'get_latest_by': 'created',
...@@ -153,7 +153,7 @@ class Migration(migrations.Migration): ...@@ -153,7 +153,7 @@ class Migration(migrations.Migration):
name='GeneratedCertificate', name='GeneratedCertificate',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(default=None, max_length=255, blank=True)), ('course_id', CourseKeyField(default=None, max_length=255, blank=True)),
('verify_uuid', models.CharField(default=b'', max_length=32, blank=True)), ('verify_uuid', models.CharField(default=b'', max_length=32, blank=True)),
('download_uuid', models.CharField(default=b'', max_length=32, blank=True)), ('download_uuid', models.CharField(default=b'', max_length=32, blank=True)),
('download_url', models.CharField(default=b'', max_length=128, blank=True)), ('download_url', models.CharField(default=b'', max_length=128, blank=True)),
......
...@@ -5,7 +5,7 @@ from django.db import migrations, models ...@@ -5,7 +5,7 @@ from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
import model_utils.fields import model_utils.fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -23,7 +23,7 @@ class Migration(migrations.Migration): ...@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255)), ('course_id', CourseKeyField(max_length=255)),
('is_regeneration', models.BooleanField(default=False)), ('is_regeneration', models.BooleanField(default=False)),
('generated_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('generated_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('instructor_task', models.ForeignKey(to='instructor_task.InstructorTask')), ('instructor_task', models.ForeignKey(to='instructor_task.InstructorTask')),
......
...@@ -68,7 +68,7 @@ from badges.events.course_meta import completion_check, course_group_check ...@@ -68,7 +68,7 @@ from badges.events.course_meta import completion_check, course_group_check
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from instructor_task.models import InstructorTask from instructor_task.models import InstructorTask
from util.milestones_helpers import fulfill_course_milestone, is_prerequisite_courses_enabled from util.milestones_helpers import fulfill_course_milestone, is_prerequisite_courses_enabled
from xmodule_django.models import CourseKeyField, NoneToEmptyManager from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, NoneToEmptyManager
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
......
...@@ -3,9 +3,11 @@ from __future__ import unicode_literals ...@@ -3,9 +3,11 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import model_utils.fields import model_utils.fields
import xmodule_django.models
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import (
CourseKeyField, LocationKeyField, BlockTypeKeyField
)
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -19,7 +21,7 @@ class Migration(migrations.Migration): ...@@ -19,7 +21,7 @@ class Migration(migrations.Migration):
name='OfflineComputedGrade', name='OfflineComputedGrade',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)),
('updated', models.DateTimeField(auto_now=True, db_index=True)), ('updated', models.DateTimeField(auto_now=True, db_index=True)),
('gradeset', models.TextField(null=True, blank=True)), ('gradeset', models.TextField(null=True, blank=True)),
...@@ -30,7 +32,7 @@ class Migration(migrations.Migration): ...@@ -30,7 +32,7 @@ class Migration(migrations.Migration):
name='OfflineComputedGradeLog', name='OfflineComputedGradeLog',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)), ('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)),
('seconds', models.IntegerField(default=0)), ('seconds', models.IntegerField(default=0)),
('nstudents', models.IntegerField(default=0)), ('nstudents', models.IntegerField(default=0)),
...@@ -46,8 +48,8 @@ class Migration(migrations.Migration): ...@@ -46,8 +48,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('location', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), ('location', LocationKeyField(max_length=255, db_index=True)),
('field', models.CharField(max_length=255)), ('field', models.CharField(max_length=255)),
('value', models.TextField(default=b'null')), ('value', models.TextField(default=b'null')),
('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
...@@ -58,8 +60,8 @@ class Migration(migrations.Migration): ...@@ -58,8 +60,8 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('module_type', models.CharField(default=b'problem', max_length=32, db_index=True, choices=[(b'problem', b'problem'), (b'video', b'video'), (b'html', b'html'), (b'course', b'course'), (b'chapter', b'Section'), (b'sequential', b'Subsection'), (b'library_content', b'Library Content')])), ('module_type', models.CharField(default=b'problem', max_length=32, db_index=True, choices=[(b'problem', b'problem'), (b'video', b'video'), (b'html', b'html'), (b'course', b'course'), (b'chapter', b'Section'), (b'sequential', b'Subsection'), (b'library_content', b'Library Content')])),
('module_state_key', xmodule_django.models.LocationKeyField(max_length=255, db_column=b'module_id', db_index=True)), ('module_state_key', LocationKeyField(max_length=255, db_column=b'module_id', db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('state', models.TextField(null=True, blank=True)), ('state', models.TextField(null=True, blank=True)),
('grade', models.FloatField(db_index=True, null=True, blank=True)), ('grade', models.FloatField(db_index=True, null=True, blank=True)),
('max_grade', models.FloatField(null=True, blank=True)), ('max_grade', models.FloatField(null=True, blank=True)),
...@@ -103,7 +105,7 @@ class Migration(migrations.Migration): ...@@ -103,7 +105,7 @@ class Migration(migrations.Migration):
('value', models.TextField(default=b'null')), ('value', models.TextField(default=b'null')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)), ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('modified', models.DateTimeField(auto_now=True, db_index=True)), ('modified', models.DateTimeField(auto_now=True, db_index=True)),
('module_type', xmodule_django.models.BlockTypeKeyField(max_length=64, db_index=True)), ('module_type', BlockTypeKeyField(max_length=64, db_index=True)),
('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
], ],
), ),
...@@ -115,7 +117,7 @@ class Migration(migrations.Migration): ...@@ -115,7 +117,7 @@ class Migration(migrations.Migration):
('value', models.TextField(default=b'null')), ('value', models.TextField(default=b'null')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)), ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('modified', models.DateTimeField(auto_now=True, db_index=True)), ('modified', models.DateTimeField(auto_now=True, db_index=True)),
('usage_id', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), ('usage_id', LocationKeyField(max_length=255, db_index=True)),
], ],
), ),
migrations.AlterUniqueTogether( migrations.AlterUniqueTogether(
......
...@@ -23,7 +23,9 @@ from django.db.models.signals import post_save ...@@ -23,7 +23,9 @@ from django.db.models.signals import post_save
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
import coursewarehistoryextended import coursewarehistoryextended
from xmodule_django.models import CourseKeyField, LocationKeyField, BlockTypeKeyField from openedx.core.djangoapps.xmodule_django.models import (
CourseKeyField, LocationKeyField, BlockTypeKeyField
)
log = logging.getLogger("edx.courseware") log = logging.getLogger("edx.courseware")
......
...@@ -5,7 +5,7 @@ controlling persistent grades. ...@@ -5,7 +5,7 @@ controlling persistent grades.
from config_models.models import ConfigurationModel from config_models.models import ConfigurationModel
from django.conf import settings from django.conf import settings
from django.db.models import BooleanField from django.db.models import BooleanField
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class PersistentGradesEnabledFlag(ConfigurationModel): class PersistentGradesEnabledFlag(ConfigurationModel):
......
...@@ -5,7 +5,7 @@ from django.db import migrations, models ...@@ -5,7 +5,7 @@ from django.db import migrations, models
import coursewarehistoryextended.fields import coursewarehistoryextended.fields
import django.utils.timezone import django.utils.timezone
import model_utils.fields import model_utils.fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -21,8 +21,8 @@ class Migration(migrations.Migration): ...@@ -21,8 +21,8 @@ class Migration(migrations.Migration):
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', 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', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=True)),
('user_id', models.IntegerField()), ('user_id', models.IntegerField()),
('course_id', xmodule_django.models.CourseKeyField(max_length=255)), ('course_id', CourseKeyField(max_length=255)),
('usage_key', xmodule_django.models.UsageKeyField(max_length=255)), ('usage_key', UsageKeyField(max_length=255)),
('subtree_edited_date', models.DateTimeField(verbose_name=b'last content edit timestamp')), ('subtree_edited_date', models.DateTimeField(verbose_name=b'last content edit timestamp')),
('course_version', models.CharField(max_length=255, verbose_name=b'guid of latest course version', blank=True)), ('course_version', models.CharField(max_length=255, verbose_name=b'guid of latest course version', blank=True)),
('earned_all', models.FloatField()), ('earned_all', models.FloatField()),
......
...@@ -4,7 +4,7 @@ from __future__ import unicode_literals ...@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -21,7 +21,7 @@ class Migration(migrations.Migration): ...@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
('enabled', models.BooleanField(default=False, verbose_name='Enabled')), ('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), ('course_id', CourseKeyField(unique=True, max_length=255, db_index=True)),
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
], ],
), ),
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.keys import CourseKey
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -16,7 +16,7 @@ class Migration(migrations.Migration): ...@@ -16,7 +16,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='visibleblocks', model_name='visibleblocks',
name='course_id', name='course_id',
field=xmodule_django.models.CourseKeyField(default=CourseKey.from_string('edX/BerylMonkeys/TNL-5458'), max_length=255, db_index=True), field=CourseKeyField(default=CourseKey.from_string('edX/BerylMonkeys/TNL-5458'), max_length=255, db_index=True),
preserve_default=False, preserve_default=False,
), ),
] ]
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -15,6 +15,6 @@ class Migration(migrations.Migration): ...@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='coursepersistentgradesflag', model_name='coursepersistentgradesflag',
name='course_id', name='course_id',
field=xmodule_django.models.CourseKeyField(max_length=255, db_index=True), field=CourseKeyField(max_length=255, db_index=True),
), ),
] ]
...@@ -4,7 +4,7 @@ from __future__ import unicode_literals ...@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
import model_utils.fields import model_utils.fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
import coursewarehistoryextended.fields import coursewarehistoryextended.fields
...@@ -22,7 +22,7 @@ class Migration(migrations.Migration): ...@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', 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', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=True)),
('user_id', models.IntegerField(db_index=True)), ('user_id', models.IntegerField(db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255)), ('course_id', CourseKeyField(max_length=255)),
('course_edited_timestamp', models.DateTimeField(verbose_name='Last content edit timestamp')), ('course_edited_timestamp', models.DateTimeField(verbose_name='Last content edit timestamp')),
('course_version', models.CharField(max_length=255, verbose_name='Course content version identifier', blank=True)), ('course_version', models.CharField(max_length=255, verbose_name='Course content version identifier', blank=True)),
('grading_policy_hash', models.CharField(max_length=255, verbose_name='Hash of grading policy')), ('grading_policy_hash', models.CharField(max_length=255, verbose_name='Hash of grading policy')),
......
...@@ -20,7 +20,7 @@ from model_utils.models import TimeStampedModel ...@@ -20,7 +20,7 @@ from model_utils.models import TimeStampedModel
from coursewarehistoryextended.fields import UnsignedBigIntAutoField from coursewarehistoryextended.fields import UnsignedBigIntAutoField
from opaque_keys.edx.keys import CourseKey, UsageKey from opaque_keys.edx.keys import CourseKey, UsageKey
from xmodule_django.models import CourseKeyField, UsageKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -18,7 +18,7 @@ class Migration(migrations.Migration): ...@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('task_type', models.CharField(max_length=50, db_index=True)), ('task_type', models.CharField(max_length=50, db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('task_key', models.CharField(max_length=255, db_index=True)), ('task_key', models.CharField(max_length=255, db_index=True)),
('task_input', models.CharField(max_length=255)), ('task_input', models.CharField(max_length=255)),
('task_id', models.CharField(max_length=255, db_index=True)), ('task_id', models.CharField(max_length=255, db_index=True)),
......
...@@ -24,7 +24,7 @@ from django.core.files.base import ContentFile ...@@ -24,7 +24,7 @@ from django.core.files.base import ContentFile
from django.db import models, transaction from django.db import models, transaction
from openedx.core.storage import get_storage from openedx.core.storage import get_storage
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
# define custom states used by InstructorTask # define custom states used by InstructorTask
......
...@@ -4,7 +4,7 @@ from __future__ import unicode_literals ...@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import provider.utils import provider.utils
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -18,8 +18,8 @@ class Migration(migrations.Migration): ...@@ -18,8 +18,8 @@ class Migration(migrations.Migration):
name='GradedAssignment', name='GradedAssignment',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
('usage_key', xmodule_django.models.UsageKeyField(max_length=255, db_index=True)), ('usage_key', UsageKeyField(max_length=255, db_index=True)),
('lis_result_sourcedid', models.CharField(max_length=255, db_index=True)), ('lis_result_sourcedid', models.CharField(max_length=255, db_index=True)),
('version_number', models.IntegerField(default=0)), ('version_number', models.IntegerField(default=0)),
], ],
......
...@@ -12,7 +12,7 @@ from django.contrib.auth.models import User ...@@ -12,7 +12,7 @@ from django.contrib.auth.models import User
from django.db import models from django.db import models
import logging import logging
from xmodule_django.models import CourseKeyField, UsageKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
from provider.utils import short_token from provider.utils import short_token
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -17,7 +17,7 @@ class Migration(migrations.Migration): ...@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
name='Note', name='Note',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('uri', models.CharField(max_length=255, db_index=True)), ('uri', models.CharField(max_length=255, db_index=True)),
('text', models.TextField(default=b'')), ('text', models.TextField(default=b'')),
('quote', models.TextField(default=b'')), ('quote', models.TextField(default=b'')),
......
...@@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError ...@@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError
from django.utils.html import strip_tags from django.utils.html import strip_tags
import json import json
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Note(models.Model): class Note(models.Model):
......
...@@ -6,7 +6,7 @@ import django.utils.timezone ...@@ -6,7 +6,7 @@ import django.utils.timezone
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import model_utils.fields import model_utils.fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -23,7 +23,7 @@ class Migration(migrations.Migration): ...@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('code', models.CharField(max_length=32, db_index=True)), ('code', models.CharField(max_length=32, db_index=True)),
('description', models.CharField(max_length=255, null=True, blank=True)), ('description', models.CharField(max_length=255, null=True, blank=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255)), ('course_id', CourseKeyField(max_length=255)),
('percentage_discount', models.IntegerField(default=0)), ('percentage_discount', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)), ('created_at', models.DateTimeField(auto_now_add=True)),
('is_active', models.BooleanField(default=True)), ('is_active', models.BooleanField(default=True)),
...@@ -42,7 +42,7 @@ class Migration(migrations.Migration): ...@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
name='CourseRegCodeItemAnnotation', name='CourseRegCodeItemAnnotation',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=128, db_index=True)), ('course_id', CourseKeyField(unique=True, max_length=128, db_index=True)),
('annotation', models.TextField(null=True)), ('annotation', models.TextField(null=True)),
], ],
), ),
...@@ -51,7 +51,7 @@ class Migration(migrations.Migration): ...@@ -51,7 +51,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('code', models.CharField(unique=True, max_length=32, db_index=True)), ('code', models.CharField(unique=True, max_length=32, db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created_at', models.DateTimeField(auto_now_add=True)), ('created_at', models.DateTimeField(auto_now_add=True)),
('mode_slug', models.CharField(max_length=100, null=True)), ('mode_slug', models.CharField(max_length=100, null=True)),
('is_valid', models.BooleanField(default=True)), ('is_valid', models.BooleanField(default=True)),
...@@ -90,7 +90,7 @@ class Migration(migrations.Migration): ...@@ -90,7 +90,7 @@ class Migration(migrations.Migration):
('zip', models.CharField(max_length=15, null=True)), ('zip', models.CharField(max_length=15, null=True)),
('country', models.CharField(max_length=64, null=True)), ('country', models.CharField(max_length=64, null=True)),
('total_amount', models.FloatField()), ('total_amount', models.FloatField()),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('internal_reference', models.CharField(help_text='Internal reference code for this invoice.', max_length=255, null=True, blank=True)), ('internal_reference', models.CharField(help_text='Internal reference code for this invoice.', max_length=255, null=True, blank=True)),
('customer_reference_number', models.CharField(help_text="Customer's reference code for this invoice.", max_length=63, null=True, blank=True)), ('customer_reference_number', models.CharField(help_text="Customer's reference code for this invoice.", max_length=63, null=True, blank=True)),
('is_valid', models.BooleanField(default=True)), ('is_valid', models.BooleanField(default=True)),
...@@ -185,7 +185,7 @@ class Migration(migrations.Migration): ...@@ -185,7 +185,7 @@ class Migration(migrations.Migration):
name='PaidCourseRegistrationAnnotation', name='PaidCourseRegistrationAnnotation',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=128, db_index=True)), ('course_id', CourseKeyField(unique=True, max_length=128, db_index=True)),
('annotation', models.TextField(null=True)), ('annotation', models.TextField(null=True)),
], ],
), ),
...@@ -204,7 +204,7 @@ class Migration(migrations.Migration): ...@@ -204,7 +204,7 @@ class Migration(migrations.Migration):
name='CertificateItem', name='CertificateItem',
fields=[ fields=[
('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')),
('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), ('course_id', CourseKeyField(max_length=128, db_index=True)),
('mode', models.SlugField()), ('mode', models.SlugField()),
('course_enrollment', models.ForeignKey(to='student.CourseEnrollment')), ('course_enrollment', models.ForeignKey(to='student.CourseEnrollment')),
], ],
...@@ -214,7 +214,7 @@ class Migration(migrations.Migration): ...@@ -214,7 +214,7 @@ class Migration(migrations.Migration):
name='CourseRegCodeItem', name='CourseRegCodeItem',
fields=[ fields=[
('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')),
('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), ('course_id', CourseKeyField(max_length=128, db_index=True)),
('mode', models.SlugField(default=b'honor')), ('mode', models.SlugField(default=b'honor')),
], ],
bases=('shoppingcart.orderitem',), bases=('shoppingcart.orderitem',),
...@@ -223,7 +223,7 @@ class Migration(migrations.Migration): ...@@ -223,7 +223,7 @@ class Migration(migrations.Migration):
name='CourseRegistrationCodeInvoiceItem', name='CourseRegistrationCodeInvoiceItem',
fields=[ fields=[
('invoiceitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.InvoiceItem')), ('invoiceitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.InvoiceItem')),
('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), ('course_id', CourseKeyField(max_length=128, db_index=True)),
], ],
bases=('shoppingcart.invoiceitem',), bases=('shoppingcart.invoiceitem',),
), ),
...@@ -232,7 +232,7 @@ class Migration(migrations.Migration): ...@@ -232,7 +232,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')),
('donation_type', models.CharField(default=b'general', max_length=32, choices=[(b'general', b'A general donation'), (b'course', b'A donation to a particular course')])), ('donation_type', models.CharField(default=b'general', max_length=32, choices=[(b'general', b'A general donation'), (b'course', b'A donation to a particular course')])),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
], ],
bases=('shoppingcart.orderitem',), bases=('shoppingcart.orderitem',),
), ),
...@@ -240,7 +240,7 @@ class Migration(migrations.Migration): ...@@ -240,7 +240,7 @@ class Migration(migrations.Migration):
name='PaidCourseRegistration', name='PaidCourseRegistration',
fields=[ fields=[
('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')), ('orderitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shoppingcart.OrderItem')),
('course_id', xmodule_django.models.CourseKeyField(max_length=128, db_index=True)), ('course_id', CourseKeyField(max_length=128, db_index=True)),
('mode', models.SlugField(default=b'honor')), ('mode', models.SlugField(default=b'honor')),
('course_enrollment', models.ForeignKey(to='student.CourseEnrollment', null=True)), ('course_enrollment', models.ForeignKey(to='student.CourseEnrollment', null=True)),
], ],
......
...@@ -39,7 +39,7 @@ from course_modes.models import CourseMode ...@@ -39,7 +39,7 @@ from course_modes.models import CourseMode
from edxmako.shortcuts import render_to_string from edxmako.shortcuts import render_to_string
from student.models import CourseEnrollment, UNENROLL_DONE, EnrollStatusChange from student.models import CourseEnrollment, UNENROLL_DONE, EnrollStatusChange
from util.query import use_read_replica_if_available from util.query import use_read_replica_if_available
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from .exceptions import ( from .exceptions import (
InvalidCartItem, InvalidCartItem,
PurchasedCallbackException, PurchasedCallbackException,
......
...@@ -5,7 +5,7 @@ from django.db import migrations, models ...@@ -5,7 +5,7 @@ from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
import model_utils.fields import model_utils.fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -23,7 +23,7 @@ class Migration(migrations.Migration): ...@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('field_name', models.CharField(max_length=255, db_index=True)), ('field_name', models.CharField(max_length=255, db_index=True)),
('field_value', models.CharField(max_length=1024)), ('field_value', models.CharField(max_length=1024)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, null=True, db_index=True)), ('course_key', CourseKeyField(max_length=255, null=True, db_index=True)),
], ],
options={ options={
'abstract': False, 'abstract': False,
......
...@@ -13,7 +13,7 @@ from model_utils.models import TimeStampedModel ...@@ -13,7 +13,7 @@ from model_utils.models import TimeStampedModel
from survey.exceptions import SurveyFormNameAlreadyExists, SurveyFormNotFound from survey.exceptions import SurveyFormNameAlreadyExists, SurveyFormNotFound
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
log = logging.getLogger("edx.survey") log = logging.getLogger("edx.survey")
......
...@@ -5,7 +5,7 @@ from django.db import migrations, models ...@@ -5,7 +5,7 @@ from django.db import migrations, models
import django_countries.fields import django_countries.fields
from django.conf import settings from django.conf import settings
import student.models import student.models
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -22,7 +22,7 @@ class Migration(migrations.Migration): ...@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
('team_id', models.CharField(unique=True, max_length=255)), ('team_id', models.CharField(unique=True, max_length=255)),
('discussion_topic_id', models.CharField(unique=True, max_length=255)), ('discussion_topic_id', models.CharField(unique=True, max_length=255)),
('name', models.CharField(max_length=255, db_index=True)), ('name', models.CharField(max_length=255, db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('topic_id', models.CharField(db_index=True, max_length=255, blank=True)), ('topic_id', models.CharField(db_index=True, max_length=255, blank=True)),
('date_created', models.DateTimeField(auto_now_add=True)), ('date_created', models.DateTimeField(auto_now_add=True)),
('description', models.CharField(max_length=300)), ('description', models.CharField(max_length=300)),
......
...@@ -23,7 +23,7 @@ from django_comment_common.signals import ( ...@@ -23,7 +23,7 @@ from django_comment_common.signals import (
comment_voted, comment_voted,
comment_endorsed comment_endorsed
) )
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from util.model_utils import slugify from util.model_utils import slugify
from student.models import LanguageField, CourseEnrollment from student.models import LanguageField, CourseEnrollment
from .errors import AlreadyOnTeamInCourse, NotEnrolledInCourseForTeam, ImmutableMembershipFieldException from .errors import AlreadyOnTeamInCourse, NotEnrolledInCourseForTeam, ImmutableMembershipFieldException
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -15,7 +15,7 @@ class Migration(migrations.Migration): ...@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
name='VerifiedTrackCohortedCourse', name='VerifiedTrackCohortedCourse',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', xmodule_django.models.CourseKeyField(help_text='The course key for the course we would like to be auto-cohorted.', unique=True, max_length=255, db_index=True)), ('course_key', CourseKeyField(help_text='The course key for the course we would like to be auto-cohorted.', unique=True, max_length=255, db_index=True)),
('enabled', models.BooleanField()), ('enabled', models.BooleanField()),
], ],
), ),
......
...@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy ...@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy
from django.dispatch import receiver from django.dispatch import receiver
from django.db.models.signals import post_save, pre_save from django.db.models.signals import post_save, pre_save
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from student.models import CourseEnrollment from student.models import CourseEnrollment
from courseware.courses import get_course_by_id from courseware.courses import get_course_by_id
......
...@@ -4,10 +4,10 @@ from __future__ import unicode_literals ...@@ -4,10 +4,10 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import lms.djangoapps.verify_student.models import lms.djangoapps.verify_student.models
import model_utils.fields import model_utils.fields
import xmodule_django.models
import django.db.models.deletion import django.db.models.deletion
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -23,7 +23,7 @@ class Migration(migrations.Migration): ...@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_key', xmodule_django.models.CourseKeyField(help_text='The course for which this deadline applies', max_length=255, db_index=True)), ('course_key', CourseKeyField(help_text='The course for which this deadline applies', max_length=255, db_index=True)),
('deadline', models.DateTimeField(help_text='The datetime after which users are no longer allowed to submit photos for verification.')), ('deadline', models.DateTimeField(help_text='The datetime after which users are no longer allowed to submit photos for verification.')),
('history_id', models.AutoField(serialize=False, primary_key=True)), ('history_id', models.AutoField(serialize=False, primary_key=True)),
('history_date', models.DateTimeField()), ('history_date', models.DateTimeField()),
...@@ -66,7 +66,7 @@ class Migration(migrations.Migration): ...@@ -66,7 +66,7 @@ class Migration(migrations.Migration):
name='SkippedReverification', name='SkippedReverification',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('created_at', models.DateTimeField(auto_now_add=True)), ('created_at', models.DateTimeField(auto_now_add=True)),
], ],
), ),
...@@ -101,7 +101,7 @@ class Migration(migrations.Migration): ...@@ -101,7 +101,7 @@ class Migration(migrations.Migration):
name='VerificationCheckpoint', name='VerificationCheckpoint',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('checkpoint_location', models.CharField(max_length=255)), ('checkpoint_location', models.CharField(max_length=255)),
('photo_verification', models.ManyToManyField(to='verify_student.SoftwareSecurePhotoVerification')), ('photo_verification', models.ManyToManyField(to='verify_student.SoftwareSecurePhotoVerification')),
], ],
...@@ -112,7 +112,7 @@ class Migration(migrations.Migration): ...@@ -112,7 +112,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_key', xmodule_django.models.CourseKeyField(help_text='The course for which this deadline applies', unique=True, max_length=255, db_index=True)), ('course_key', CourseKeyField(help_text='The course for which this deadline applies', unique=True, max_length=255, db_index=True)),
('deadline', models.DateTimeField(help_text='The datetime after which users are no longer allowed to submit photos for verification.')), ('deadline', models.DateTimeField(help_text='The datetime after which users are no longer allowed to submit photos for verification.')),
], ],
options={ options={
......
...@@ -44,7 +44,7 @@ from lms.djangoapps.verify_student.ssencrypt import ( ...@@ -44,7 +44,7 @@ from lms.djangoapps.verify_student.ssencrypt import (
) )
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -3,10 +3,10 @@ from __future__ import unicode_literals ...@@ -3,10 +3,10 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import model_utils.fields import model_utils.fields
import xmodule_django.models
import jsonfield.fields import jsonfield.fields
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, LocationKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -22,8 +22,8 @@ class Migration(migrations.Migration): ...@@ -22,8 +22,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
('usage_key', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)), ('usage_key', LocationKeyField(max_length=255, db_index=True)),
('_path', jsonfield.fields.JSONField(help_text=b'Path in course tree to the block', db_column=b'path')), ('_path', jsonfield.fields.JSONField(help_text=b'Path in course tree to the block', db_column=b'path')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
], ],
...@@ -34,8 +34,8 @@ class Migration(migrations.Migration): ...@@ -34,8 +34,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_key', CourseKeyField(max_length=255, db_index=True)),
('usage_key', xmodule_django.models.LocationKeyField(unique=True, max_length=255, db_index=True)), ('usage_key', LocationKeyField(unique=True, max_length=255, db_index=True)),
('display_name', models.CharField(default=b'', max_length=255)), ('display_name', models.CharField(default=b'', max_length=255)),
('_paths', jsonfield.fields.JSONField(default=[], help_text=b'All paths in course tree to the corresponding block.', db_column=b'paths')), ('_paths', jsonfield.fields.JSONField(default=[], help_text=b'All paths in course tree to the corresponding block.', db_column=b'paths')),
], ],
......
...@@ -13,7 +13,7 @@ from opaque_keys.edx.keys import UsageKey ...@@ -13,7 +13,7 @@ from opaque_keys.edx.keys import UsageKey
from xmodule.modulestore import search from xmodule.modulestore import search
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem
from xmodule_django.models import CourseKeyField, LocationKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, LocationKeyField
from . import PathItem from . import PathItem
......
...@@ -4,7 +4,7 @@ from __future__ import unicode_literals ...@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
import model_utils.fields import model_utils.fields
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -19,8 +19,8 @@ class Migration(migrations.Migration): ...@@ -19,8 +19,8 @@ class Migration(migrations.Migration):
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('version', models.IntegerField()), ('version', models.IntegerField()),
('id', xmodule_django.models.CourseKeyField(max_length=255, serialize=False, primary_key=True, db_index=True)), ('id', CourseKeyField(max_length=255, serialize=False, primary_key=True, db_index=True)),
('_location', xmodule_django.models.UsageKeyField(max_length=255)), ('_location', UsageKeyField(max_length=255)),
('display_name', models.TextField(null=True)), ('display_name', models.TextField(null=True)),
('display_number_with_default', models.TextField()), ('display_number_with_default', models.TextField()),
('display_org_with_default', models.TextField()), ('display_org_with_default', models.TextField()),
......
...@@ -25,7 +25,7 @@ from xmodule import course_metadata_utils, block_metadata_utils ...@@ -25,7 +25,7 @@ from xmodule import course_metadata_utils, block_metadata_utils
from xmodule.course_module import CourseDescriptor, DEFAULT_START_DATE from xmodule.course_module import CourseDescriptor, DEFAULT_START_DATE
from xmodule.error_module import ErrorDescriptor from xmodule.error_module import ErrorDescriptor
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule_django.models import CourseKeyField, UsageKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -398,7 +398,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase): ...@@ -398,7 +398,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
# default value present. So mock it to avoid returning the empty str as primary key # default value present. So mock it to avoid returning the empty str as primary key
# value. Due to empty str, model.save will do an update instead of insert which is # value. Due to empty str, model.save will do an update instead of insert which is
# incorrect and get exception in # incorrect and get exception in
# common.djangoapps.xmodule_django.models.OpaqueKeyField.get_prep_value # openedx.core.djangoapps.xmodule_django.models.OpaqueKeyField.get_prep_value
with mock.patch('django.db.models.Field.get_pk_value_on_save') as mock_get_pk_value_on_save: with mock.patch('django.db.models.Field.get_pk_value_on_save') as mock_get_pk_value_on_save:
mock_get_pk_value_on_save.return_value = None mock_get_pk_value_on_save.return_value = None
......
...@@ -5,7 +5,7 @@ from django.db import migrations, models ...@@ -5,7 +5,7 @@ from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
import model_utils.fields import model_utils.fields
import util.models import util.models
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -20,7 +20,7 @@ class Migration(migrations.Migration): ...@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)), ('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)), ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
('course_id', xmodule_django.models.CourseKeyField(unique=True, max_length=255, verbose_name=b'Course ID', db_index=True)), ('course_id', CourseKeyField(unique=True, max_length=255, verbose_name=b'Course ID', db_index=True)),
('structure_json', util.models.CompressedTextField(null=True, verbose_name=b'Structure JSON', blank=True)), ('structure_json', util.models.CompressedTextField(null=True, verbose_name=b'Structure JSON', blank=True)),
('discussion_id_map_json', util.models.CompressedTextField(null=True, verbose_name=b'Discussion ID Map JSON', blank=True)), ('discussion_id_map_json', util.models.CompressedTextField(null=True, verbose_name=b'Discussion ID Map JSON', blank=True)),
], ],
......
...@@ -8,7 +8,7 @@ from collections import OrderedDict ...@@ -8,7 +8,7 @@ from collections import OrderedDict
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from util.models import CompressedTextField from util.models import CompressedTextField
from xmodule_django.models import CourseKeyField, UsageKey from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKey
logger = logging.getLogger(__name__) # pylint: disable=invalid-name logger = logging.getLogger(__name__) # pylint: disable=invalid-name
......
...@@ -4,13 +4,13 @@ Course Structure Content sub-application test cases ...@@ -4,13 +4,13 @@ Course Structure Content sub-application test cases
import json import json
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from xmodule_django.models import UsageKey
from xmodule.modulestore.django import SignalHandler from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from openedx.core.djangoapps.content.course_structures.models import CourseStructure from openedx.core.djangoapps.content.course_structures.models import CourseStructure
from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish
from openedx.core.djangoapps.content.course_structures.tasks import _generate_course_structure, update_course_structure from openedx.core.djangoapps.content.course_structures.tasks import _generate_course_structure, update_course_structure
from openedx.core.djangoapps.xmodule_django.models import UsageKey
class SignalDisconnectTestMixin(object): class SignalDisconnectTestMixin(object):
......
...@@ -3,7 +3,7 @@ from __future__ import unicode_literals ...@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -17,7 +17,7 @@ class Migration(migrations.Migration): ...@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
name='CohortMembership', name='CohortMembership',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255)), ('course_id', CourseKeyField(max_length=255)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -32,7 +32,7 @@ class Migration(migrations.Migration): ...@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('is_cohorted', models.BooleanField(default=False)), ('is_cohorted', models.BooleanField(default=False)),
('course_id', xmodule_django.models.CourseKeyField(help_text=b'Which course are these settings associated with?', unique=True, max_length=255, db_index=True)), ('course_id', CourseKeyField(help_text=b'Which course are these settings associated with?', unique=True, max_length=255, db_index=True)),
('_cohorted_discussions', models.TextField(null=True, db_column=b'cohorted_discussions', blank=True)), ('_cohorted_discussions', models.TextField(null=True, db_column=b'cohorted_discussions', blank=True)),
('always_cohort_inline_discussions', models.BooleanField(default=True)), ('always_cohort_inline_discussions', models.BooleanField(default=True)),
], ],
...@@ -42,7 +42,7 @@ class Migration(migrations.Migration): ...@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(help_text=b'What is the name of this group? Must be unique within a course.', max_length=255)), ('name', models.CharField(help_text=b'What is the name of this group? Must be unique within a course.', max_length=255)),
('course_id', xmodule_django.models.CourseKeyField(help_text=b'Which course is this group associated with?', max_length=255, db_index=True)), ('course_id', CourseKeyField(help_text=b'Which course is this group associated with?', max_length=255, db_index=True)),
('group_type', models.CharField(max_length=20, choices=[(b'cohort', b'Cohort')])), ('group_type', models.CharField(max_length=20, choices=[(b'cohort', b'Cohort')])),
('users', models.ManyToManyField(help_text=b'Who is in this group?', related_name='course_groups', to=settings.AUTH_USER_MODEL, db_index=True)), ('users', models.ManyToManyField(help_text=b'Who is in this group?', related_name='course_groups', to=settings.AUTH_USER_MODEL, db_index=True)),
], ],
......
...@@ -11,7 +11,7 @@ from util.db import outer_atomic ...@@ -11,7 +11,7 @@ from util.db import outer_atomic
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db.models.signals import pre_delete from django.db.models.signals import pre_delete
from django.dispatch import receiver from django.dispatch import receiver
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -4,12 +4,12 @@ from __future__ import unicode_literals ...@@ -4,12 +4,12 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import openedx.core.djangoapps.credit.models import openedx.core.djangoapps.credit.models
import model_utils.fields import model_utils.fields
import xmodule_django.models
import jsonfield.fields import jsonfield.fields
import django.db.models.deletion import django.db.models.deletion
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
import django.core.validators import django.core.validators
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -23,7 +23,7 @@ class Migration(migrations.Migration): ...@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
name='CreditCourse', name='CreditCourse',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_key', xmodule_django.models.CourseKeyField(unique=True, max_length=255, db_index=True)), ('course_key', CourseKeyField(unique=True, max_length=255, db_index=True)),
('enabled', models.BooleanField(default=False)), ('enabled', models.BooleanField(default=False)),
], ],
), ),
......
...@@ -21,7 +21,7 @@ from jsonfield.fields import JSONField ...@@ -21,7 +21,7 @@ from jsonfield.fields import JSONField
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
import pytz import pytz
from simple_history.models import HistoricalRecords from simple_history.models import HistoricalRecords
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
CREDIT_PROVIDER_ID_REGEX = r"[a-z,A-Z,0-9,\-]+" CREDIT_PROVIDER_ID_REGEX = r"[a-z,A-Z,0-9,\-]+"
......
...@@ -6,7 +6,7 @@ import django.utils.timezone ...@@ -6,7 +6,7 @@ import django.utils.timezone
from django.conf import settings from django.conf import settings
import model_utils.fields import model_utils.fields
import django.core.validators import django.core.validators
import xmodule_django.models from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration): class Migration(migrations.Migration):
...@@ -21,7 +21,7 @@ class Migration(migrations.Migration): ...@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('key', models.CharField(max_length=255, db_index=True)), ('key', models.CharField(max_length=255, db_index=True)),
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)), ('course_id', CourseKeyField(max_length=255, db_index=True)),
('value', models.TextField()), ('value', models.TextField()),
('user', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)),
], ],
......
...@@ -9,7 +9,7 @@ from django.dispatch import receiver ...@@ -9,7 +9,7 @@ from django.dispatch import receiver
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from util.model_utils import get_changed_fields_dict, emit_setting_changed_event from util.model_utils import get_changed_fields_dict, emit_setting_changed_event
from xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
# Currently, the "student" app is responsible for # Currently, the "student" app is responsible for
# accounts, profiles, enrollments, and the student dashboard. # accounts, profiles, enrollments, and the student dashboard.
......
...@@ -27,7 +27,7 @@ class NoneToEmptyManager(models.Manager): ...@@ -27,7 +27,7 @@ class NoneToEmptyManager(models.Manager):
""" """
Returns the result of NoneToEmptyQuerySet instead of a regular QuerySet. Returns the result of NoneToEmptyQuerySet instead of a regular QuerySet.
""" """
return NoneToEmptyQuerySet(self.model, using=self._db) return NoneToEmptyQuerySet(self.model, using=self._db) # pylint: disable=no-member
class NoneToEmptyQuerySet(models.query.QuerySet): class NoneToEmptyQuerySet(models.query.QuerySet):
...@@ -40,6 +40,7 @@ class NoneToEmptyQuerySet(models.query.QuerySet): ...@@ -40,6 +40,7 @@ class NoneToEmptyQuerySet(models.query.QuerySet):
empty value. empty value.
""" """
def _filter_or_exclude(self, *args, **kwargs): def _filter_or_exclude(self, *args, **kwargs):
# pylint: disable=protected-access
for name in self.model._meta.get_all_field_names(): for name in self.model._meta.get_all_field_names():
field_object, _model, direct, _m2m = self.model._meta.get_field_by_name(name) field_object, _model, direct, _m2m = self.model._meta.get_field_by_name(name)
if direct and hasattr(field_object, 'Empty'): if direct and hasattr(field_object, 'Empty'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment