Merge pull request #13671 from edx/jeskew/move_xmodule_django_to_openedx_core
Move xmodule_django app to openedx.core.djangoapps
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('created_time', models.DateTimeField(auto_now_add=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)),
|
||||
('state', models.CharField(max_length=50)),
|
||||
('should_display', models.BooleanField(default=False)),
|
||||
('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)),
|
||||
('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)),
|
||||
|
||||
@@ -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.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
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseMode',
|
||||
fields=[
|
||||
('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_display_name', models.CharField(max_length=255, verbose_name='Display Name')),
|
||||
('min_price', models.IntegerField(default=0, verbose_name='Price')),
|
||||
@@ -31,7 +31,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseModesArchive',
|
||||
fields=[
|
||||
('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_display_name', models.CharField(max_length=255)),
|
||||
('min_price', models.IntegerField(default=0)),
|
||||
|
||||
@@ -10,7 +10,7 @@ from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
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',
|
||||
[
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('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)),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -12,7 +12,7 @@ from student.models import CourseEnrollment
|
||||
|
||||
from xmodule.modulestore.django import modulestore
|
||||
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_MODERATOR = ugettext_noop('Moderator')
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import migrations, models
|
||||
import django_countries.fields
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -38,7 +38,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=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)),
|
||||
],
|
||||
options={
|
||||
@@ -49,7 +49,7 @@ class Migration(migrations.Migration):
|
||||
name='EmbargoedCourse',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
@@ -86,7 +86,7 @@ class Migration(migrations.Migration):
|
||||
name='RestrictedCourse',
|
||||
fields=[
|
||||
('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')])),
|
||||
('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.')),
|
||||
|
||||
@@ -25,7 +25,7 @@ from django_countries.fields import CountryField
|
||||
from django_countries import countries
|
||||
|
||||
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.messages import ENROLL_MESSAGES, COURSEWARE_MESSAGES
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseMessage',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import models
|
||||
from django.contrib import admin
|
||||
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.admin import ConfigurationModelAdmin
|
||||
|
||||
@@ -6,7 +6,7 @@ import django.utils.timezone
|
||||
import django_countries.fields
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
('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)),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
@@ -39,7 +39,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseEnrollment',
|
||||
fields=[
|
||||
('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)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('mode', models.CharField(default=b'honor', max_length=100)),
|
||||
@@ -54,7 +54,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=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)),
|
||||
('created', models.DateTimeField(db_index=True, auto_now_add=True, null=True)),
|
||||
],
|
||||
@@ -101,7 +101,7 @@ class Migration(migrations.Migration):
|
||||
name='EntranceExamConfiguration',
|
||||
fields=[
|
||||
('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)),
|
||||
('updated', models.DateTimeField(auto_now=True, db_index=True)),
|
||||
('skip_entrance_exam', models.BooleanField(default=True)),
|
||||
@@ -112,7 +112,7 @@ class Migration(migrations.Migration):
|
||||
name='HistoricalCourseEnrollment',
|
||||
fields=[
|
||||
('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)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('mode', models.CharField(default=b'honor', max_length=100)),
|
||||
|
||||
@@ -45,7 +45,7 @@ from opaque_keys.edx.keys import CourseKey
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from simple_history.models import HistoricalRecords
|
||||
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 certificates.models import GeneratedCertificate
|
||||
|
||||
@@ -9,7 +9,7 @@ from django.contrib.auth.models import User
|
||||
import logging
|
||||
|
||||
from student.models import CourseAccessRole
|
||||
from xmodule_django.models import CourseKeyField
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -11,7 +11,7 @@ from openedx.core.lib.api.authentication import (
|
||||
OAuth2AuthenticationAllowInactiveUser,
|
||||
SessionAuthenticationAllowInactiveUser
|
||||
)
|
||||
from xmodule_django.models import CourseKeyField
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
from badges.models import BadgeAssertion
|
||||
from .serializers import BadgeAssertionSerializer
|
||||
|
||||
@@ -7,7 +7,7 @@ import badges.models
|
||||
from django.conf import settings
|
||||
import django.utils.timezone
|
||||
from model_utils import fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -36,7 +36,7 @@ class Migration(migrations.Migration):
|
||||
('slug', models.SlugField(max_length=255, 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)),
|
||||
('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()),
|
||||
('criteria', models.TextField()),
|
||||
('mode', models.CharField(default=b'', max_length=100, blank=True)),
|
||||
|
||||
@@ -17,7 +17,7 @@ from opaque_keys.edx.keys import CourseKey
|
||||
from badges.utils import deserialize_count_specs
|
||||
from config_models.models import ConfigurationModel
|
||||
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):
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseAuthorization',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
@@ -31,7 +31,7 @@ class Migration(migrations.Migration):
|
||||
('text_message', models.TextField(null=True, blank=True)),
|
||||
('created', models.DateTimeField(auto_now_add=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')])),
|
||||
('template_name', models.CharField(max_length=255, null=True)),
|
||||
('from_addr', models.CharField(max_length=255, null=True)),
|
||||
@@ -51,7 +51,7 @@ class Migration(migrations.Migration):
|
||||
name='Optout',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -15,7 +15,7 @@ from openedx.core.lib.mail_utils import wrap_message
|
||||
from config_models.models import ConfigurationModel
|
||||
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.query import use_read_replica_if_available
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, LocationKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
name='CcxFieldOverride',
|
||||
fields=[
|
||||
('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)),
|
||||
('value', models.TextField(default=b'null')),
|
||||
],
|
||||
@@ -26,7 +26,7 @@ class Migration(migrations.Migration):
|
||||
name='CustomCourseForEdX',
|
||||
fields=[
|
||||
('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)),
|
||||
('coach', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
|
||||
@@ -11,7 +11,7 @@ from pytz import utc
|
||||
|
||||
from lazy import lazy
|
||||
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.modulestore.django import modulestore
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from opaque_keys.edx.keys import CourseKey
|
||||
from branding import api as branding_api
|
||||
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
|
||||
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 certificates.models import (
|
||||
|
||||
@@ -4,13 +4,13 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import certificates.models
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
import django_extensions.db.fields
|
||||
import django_extensions.db.fields.json
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from badges.models import validate_badge_image
|
||||
from django.conf import settings
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
|
||||
name='BadgeAssertion',
|
||||
fields=[
|
||||
('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)),
|
||||
('data', django_extensions.db.fields.json.JSONField()),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
@@ -58,7 +58,7 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('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)),
|
||||
],
|
||||
options={
|
||||
@@ -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)),
|
||||
('template', models.TextField(help_text='Django template HTML.')),
|
||||
('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)),
|
||||
('is_active', models.BooleanField(default=False, help_text='On/Off switch.')),
|
||||
],
|
||||
@@ -114,7 +114,7 @@ class Migration(migrations.Migration):
|
||||
name='CertificateWhitelist',
|
||||
fields=[
|
||||
('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)),
|
||||
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
|
||||
('notes', models.TextField(default=None, null=True)),
|
||||
@@ -143,7 +143,7 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('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={
|
||||
'get_latest_by': 'created',
|
||||
@@ -153,7 +153,7 @@ class Migration(migrations.Migration):
|
||||
name='GeneratedCertificate',
|
||||
fields=[
|
||||
('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)),
|
||||
('download_uuid', models.CharField(default=b'', max_length=32, blank=True)),
|
||||
('download_url', models.CharField(default=b'', max_length=128, blank=True)),
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('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)),
|
||||
('course_id', xmodule_django.models.CourseKeyField(max_length=255)),
|
||||
('course_id', CourseKeyField(max_length=255)),
|
||||
('is_regeneration', models.BooleanField(default=False)),
|
||||
('generated_by', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
('instructor_task', models.ForeignKey(to='instructor_task.InstructorTask')),
|
||||
|
||||
@@ -68,7 +68,7 @@ from badges.events.course_meta import completion_check, course_group_check
|
||||
from config_models.models import ConfigurationModel
|
||||
from instructor_task.models import InstructorTask
|
||||
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__)
|
||||
|
||||
|
||||
@@ -3,9 +3,11 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
from openedx.core.djangoapps.xmodule_django.models import (
|
||||
CourseKeyField, LocationKeyField, BlockTypeKeyField
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -19,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
name='OfflineComputedGrade',
|
||||
fields=[
|
||||
('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)),
|
||||
('updated', models.DateTimeField(auto_now=True, db_index=True)),
|
||||
('gradeset', models.TextField(null=True, blank=True)),
|
||||
@@ -30,7 +32,7 @@ class Migration(migrations.Migration):
|
||||
name='OfflineComputedGradeLog',
|
||||
fields=[
|
||||
('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)),
|
||||
('seconds', models.IntegerField(default=0)),
|
||||
('nstudents', models.IntegerField(default=0)),
|
||||
@@ -46,8 +48,8 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('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)),
|
||||
('location', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)),
|
||||
('course_id', CourseKeyField(max_length=255, db_index=True)),
|
||||
('location', LocationKeyField(max_length=255, db_index=True)),
|
||||
('field', models.CharField(max_length=255)),
|
||||
('value', models.TextField(default=b'null')),
|
||||
('student', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
@@ -58,8 +60,8 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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_state_key', xmodule_django.models.LocationKeyField(max_length=255, db_column=b'module_id', db_index=True)),
|
||||
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)),
|
||||
('module_state_key', LocationKeyField(max_length=255, db_column=b'module_id', db_index=True)),
|
||||
('course_id', CourseKeyField(max_length=255, db_index=True)),
|
||||
('state', models.TextField(null=True, blank=True)),
|
||||
('grade', models.FloatField(db_index=True, null=True, blank=True)),
|
||||
('max_grade', models.FloatField(null=True, blank=True)),
|
||||
@@ -103,7 +105,7 @@ class Migration(migrations.Migration):
|
||||
('value', models.TextField(default=b'null')),
|
||||
('created', models.DateTimeField(auto_now_add=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)),
|
||||
],
|
||||
),
|
||||
@@ -115,7 +117,7 @@ class Migration(migrations.Migration):
|
||||
('value', models.TextField(default=b'null')),
|
||||
('created', models.DateTimeField(auto_now_add=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(
|
||||
|
||||
@@ -23,7 +23,9 @@ from django.db.models.signals import post_save
|
||||
from model_utils.models import TimeStampedModel
|
||||
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")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ controlling persistent grades.
|
||||
from config_models.models import ConfigurationModel
|
||||
from django.conf import settings
|
||||
from django.db.models import BooleanField
|
||||
from xmodule_django.models import CourseKeyField
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class PersistentGradesEnabledFlag(ConfigurationModel):
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import migrations, models
|
||||
import coursewarehistoryextended.fields
|
||||
import django.utils.timezone
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('id', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=True)),
|
||||
('user_id', models.IntegerField()),
|
||||
('course_id', xmodule_django.models.CourseKeyField(max_length=255)),
|
||||
('usage_key', xmodule_django.models.UsageKeyField(max_length=255)),
|
||||
('course_id', CourseKeyField(max_length=255)),
|
||||
('usage_key', UsageKeyField(max_length=255)),
|
||||
('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)),
|
||||
('earned_all', models.FloatField()),
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
|
||||
('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')),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -16,7 +16,7 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='visibleblocks',
|
||||
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,
|
||||
),
|
||||
]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='coursepersistentgradesflag',
|
||||
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
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
import coursewarehistoryextended.fields
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
|
||||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
|
||||
('id', coursewarehistoryextended.fields.UnsignedBigIntAutoField(serialize=False, primary_key=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_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')),
|
||||
|
||||
@@ -20,7 +20,7 @@ from model_utils.models import TimeStampedModel
|
||||
|
||||
from coursewarehistoryextended.fields import UnsignedBigIntAutoField
|
||||
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__)
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=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_input', models.CharField(max_length=255)),
|
||||
('task_id', models.CharField(max_length=255, db_index=True)),
|
||||
|
||||
@@ -24,7 +24,7 @@ from django.core.files.base import ContentFile
|
||||
from django.db import models, transaction
|
||||
|
||||
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
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import provider.utils
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -18,8 +18,8 @@ class Migration(migrations.Migration):
|
||||
name='GradedAssignment',
|
||||
fields=[
|
||||
('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)),
|
||||
('usage_key', xmodule_django.models.UsageKeyField(max_length=255, db_index=True)),
|
||||
('course_key', CourseKeyField(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)),
|
||||
('version_number', models.IntegerField(default=0)),
|
||||
],
|
||||
|
||||
@@ -12,7 +12,7 @@ from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
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
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
name='Note',
|
||||
fields=[
|
||||
('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)),
|
||||
('text', models.TextField(default=b'')),
|
||||
('quote', models.TextField(default=b'')),
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError
|
||||
from django.utils.html import strip_tags
|
||||
import json
|
||||
|
||||
from xmodule_django.models import CourseKeyField
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Note(models.Model):
|
||||
|
||||
@@ -6,7 +6,7 @@ import django.utils.timezone
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('code', models.CharField(max_length=32, db_index=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)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseRegCodeItemAnnotation',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
@@ -51,7 +51,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
('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)),
|
||||
('mode_slug', models.CharField(max_length=100, null=True)),
|
||||
('is_valid', models.BooleanField(default=True)),
|
||||
@@ -90,7 +90,7 @@ class Migration(migrations.Migration):
|
||||
('zip', models.CharField(max_length=15, null=True)),
|
||||
('country', models.CharField(max_length=64, null=True)),
|
||||
('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)),
|
||||
('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)),
|
||||
@@ -185,7 +185,7 @@ class Migration(migrations.Migration):
|
||||
name='PaidCourseRegistrationAnnotation',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
@@ -204,7 +204,7 @@ class Migration(migrations.Migration):
|
||||
name='CertificateItem',
|
||||
fields=[
|
||||
('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()),
|
||||
('course_enrollment', models.ForeignKey(to='student.CourseEnrollment')),
|
||||
],
|
||||
@@ -214,7 +214,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseRegCodeItem',
|
||||
fields=[
|
||||
('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')),
|
||||
],
|
||||
bases=('shoppingcart.orderitem',),
|
||||
@@ -223,7 +223,7 @@ class Migration(migrations.Migration):
|
||||
name='CourseRegistrationCodeInvoiceItem',
|
||||
fields=[
|
||||
('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',),
|
||||
),
|
||||
@@ -232,7 +232,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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')])),
|
||||
('course_id', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)),
|
||||
('course_id', CourseKeyField(max_length=255, db_index=True)),
|
||||
],
|
||||
bases=('shoppingcart.orderitem',),
|
||||
),
|
||||
@@ -240,7 +240,7 @@ class Migration(migrations.Migration):
|
||||
name='PaidCourseRegistration',
|
||||
fields=[
|
||||
('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')),
|
||||
('course_enrollment', models.ForeignKey(to='student.CourseEnrollment', null=True)),
|
||||
],
|
||||
|
||||
@@ -39,7 +39,7 @@ from course_modes.models import CourseMode
|
||||
from edxmako.shortcuts import render_to_string
|
||||
from student.models import CourseEnrollment, UNENROLL_DONE, EnrollStatusChange
|
||||
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 (
|
||||
InvalidCartItem,
|
||||
PurchasedCallbackException,
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('field_name', models.CharField(max_length=255, db_index=True)),
|
||||
('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={
|
||||
'abstract': False,
|
||||
|
||||
@@ -13,7 +13,7 @@ from model_utils.models import TimeStampedModel
|
||||
|
||||
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")
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import migrations, models
|
||||
import django_countries.fields
|
||||
from django.conf import settings
|
||||
import student.models
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
|
||||
('team_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)),
|
||||
('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)),
|
||||
('date_created', models.DateTimeField(auto_now_add=True)),
|
||||
('description', models.CharField(max_length=300)),
|
||||
|
||||
@@ -23,7 +23,7 @@ from django_comment_common.signals import (
|
||||
comment_voted,
|
||||
comment_endorsed
|
||||
)
|
||||
from xmodule_django.models import CourseKeyField
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
from util.model_utils import slugify
|
||||
from student.models import LanguageField, CourseEnrollment
|
||||
from .errors import AlreadyOnTeamInCourse, NotEnrolledInCourseForTeam, ImmutableMembershipFieldException
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
|
||||
name='VerifiedTrackCohortedCourse',
|
||||
fields=[
|
||||
('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()),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy
|
||||
from django.dispatch import receiver
|
||||
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 courseware.courses import get_course_by_id
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import lms.djangoapps.verify_student.models
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('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)),
|
||||
('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.')),
|
||||
('history_id', models.AutoField(serialize=False, primary_key=True)),
|
||||
('history_date', models.DateTimeField()),
|
||||
@@ -66,7 +66,7 @@ class Migration(migrations.Migration):
|
||||
name='SkippedReverification',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
@@ -101,7 +101,7 @@ class Migration(migrations.Migration):
|
||||
name='VerificationCheckpoint',
|
||||
fields=[
|
||||
('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)),
|
||||
('photo_verification', models.ManyToManyField(to='verify_student.SoftwareSecurePhotoVerification')),
|
||||
],
|
||||
@@ -112,7 +112,7 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('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.')),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -44,7 +44,7 @@ from lms.djangoapps.verify_student.ssencrypt import (
|
||||
)
|
||||
from xmodule.modulestore.django import modulestore
|
||||
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
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -3,10 +3,10 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
import jsonfield.fields
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, LocationKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('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)),
|
||||
('course_key', xmodule_django.models.CourseKeyField(max_length=255, db_index=True)),
|
||||
('usage_key', xmodule_django.models.LocationKeyField(max_length=255, db_index=True)),
|
||||
('course_key', CourseKeyField(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')),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
@@ -34,8 +34,8 @@ class Migration(migrations.Migration):
|
||||
('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)),
|
||||
('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)),
|
||||
('usage_key', xmodule_django.models.LocationKeyField(unique=True, max_length=255, db_index=True)),
|
||||
('course_key', CourseKeyField(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)),
|
||||
('_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
|
||||
from xmodule.modulestore import search
|
||||
from xmodule.modulestore.django import modulestore
|
||||
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
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField, UsageKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
|
||||
('version', models.IntegerField()),
|
||||
('id', xmodule_django.models.CourseKeyField(max_length=255, serialize=False, primary_key=True, db_index=True)),
|
||||
('_location', xmodule_django.models.UsageKeyField(max_length=255)),
|
||||
('id', CourseKeyField(max_length=255, serialize=False, primary_key=True, db_index=True)),
|
||||
('_location', UsageKeyField(max_length=255)),
|
||||
('display_name', models.TextField(null=True)),
|
||||
('display_number_with_default', models.TextField()),
|
||||
('display_org_with_default', models.TextField()),
|
||||
|
||||
@@ -25,7 +25,7 @@ from xmodule import course_metadata_utils, block_metadata_utils
|
||||
from xmodule.course_module import CourseDescriptor, DEFAULT_START_DATE
|
||||
from xmodule.error_module import ErrorDescriptor
|
||||
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__)
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
|
||||
# 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
|
||||
# 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:
|
||||
|
||||
mock_get_pk_value_on_save.return_value = None
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
import model_utils.fields
|
||||
import util.models
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
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)),
|
||||
('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)),
|
||||
('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)),
|
||||
('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
|
||||
from model_utils.models import TimeStampedModel
|
||||
|
||||
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
|
||||
|
||||
@@ -4,13 +4,13 @@ Course Structure Content sub-application test cases
|
||||
import json
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
from xmodule_django.models import UsageKey
|
||||
from xmodule.modulestore.django import SignalHandler
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
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.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.xmodule_django.models import UsageKey
|
||||
|
||||
|
||||
class SignalDisconnectTestMixin(object):
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
name='CohortMembership',
|
||||
fields=[
|
||||
('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(
|
||||
@@ -32,7 +32,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('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)),
|
||||
('always_cohort_inline_discussions', models.BooleanField(default=True)),
|
||||
],
|
||||
@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('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)),
|
||||
('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')])),
|
||||
('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
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db.models.signals import pre_delete
|
||||
from django.dispatch import receiver
|
||||
from xmodule_django.models import CourseKeyField
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
import openedx.core.djangoapps.credit.models
|
||||
import model_utils.fields
|
||||
import xmodule_django.models
|
||||
import jsonfield.fields
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
import django.core.validators
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
|
||||
name='CreditCourse',
|
||||
fields=[
|
||||
('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)),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -21,7 +21,7 @@ from jsonfield.fields import JSONField
|
||||
from model_utils.models import TimeStampedModel
|
||||
import pytz
|
||||
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,\-]+"
|
||||
|
||||
@@ -6,7 +6,7 @@ import django.utils.timezone
|
||||
from django.conf import settings
|
||||
import model_utils.fields
|
||||
import django.core.validators
|
||||
import xmodule_django.models
|
||||
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=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()),
|
||||
('user', models.ForeignKey(related_name='+', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
|
||||
@@ -9,7 +9,7 @@ from django.dispatch import receiver
|
||||
from model_utils.models import TimeStampedModel
|
||||
|
||||
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
|
||||
# accounts, profiles, enrollments, and the student dashboard.
|
||||
|
||||
@@ -27,7 +27,7 @@ class NoneToEmptyManager(models.Manager):
|
||||
"""
|
||||
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):
|
||||
@@ -40,6 +40,7 @@ class NoneToEmptyQuerySet(models.query.QuerySet):
|
||||
empty value.
|
||||
"""
|
||||
def _filter_or_exclude(self, *args, **kwargs):
|
||||
# pylint: disable=protected-access
|
||||
for name in self.model._meta.get_all_field_names():
|
||||
field_object, _model, direct, _m2m = self.model._meta.get_field_by_name(name)
|
||||
if direct and hasattr(field_object, 'Empty'):
|
||||
Reference in New Issue
Block a user