Commit 70af296f by Clinton Blackburn

Fixed abstract model declaration

ECOM-3970
parent 82ce9b92
......@@ -3,44 +3,29 @@ from __future__ import unicode_literals
from django.db import migrations, models
import django_extensions.db.fields
from django.conf import settings
import sortedm2m.fields
import django.db.models.deletion
import sortedm2m.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0005_populate_currencies'),
('ietf_language_tags', '0002_language_tag_data_migration'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('ietf_language_tags', '0002_language_tag_data_migration'),
]
operations = [
migrations.CreateModel(
name='AbstractMediaModel',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('src', models.URLField(unique=True, max_length=255)),
('description', models.CharField(max_length=255, blank=True, null=True)),
],
options={
'ordering': ('-modified', '-created'),
'get_latest_by': 'modified',
'abstract': False,
},
),
migrations.CreateModel(
name='Course',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255, db_index=True)),
('title', models.CharField(max_length=255, default=None, blank=True, null=True)),
('short_description', models.CharField(max_length=255, default=None, blank=True, null=True)),
('key', models.CharField(db_index=True, max_length=255, unique=True)),
('title', models.CharField(default=None, blank=True, max_length=255, null=True)),
('short_description', models.CharField(default=None, blank=True, max_length=255, null=True)),
('full_description', models.TextField(default=None, blank=True, null=True)),
],
options={
......@@ -52,8 +37,8 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='CourseOrganization',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('relation_type', models.CharField(max_length=63, choices=[('owner', 'Owner'), ('sponsor', 'Sponsor')])),
('course', models.ForeignKey(to='course_metadata.Course')),
......@@ -62,22 +47,22 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='CourseRun',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255)),
('title_override', models.CharField(max_length=255, default=None, help_text="Title specific for this run of a course. Leave this value blank to default to the parent course's title.", blank=True, null=True)),
('key', models.CharField(max_length=255, unique=True)),
('title_override', models.CharField(default=None, blank=True, max_length=255, null=True, help_text="Title specific for this run of a course. Leave this value blank to default to the parent course's title.")),
('start', models.DateTimeField(blank=True, null=True)),
('end', models.DateTimeField(blank=True, null=True)),
('enrollment_start', models.DateTimeField(blank=True, null=True)),
('enrollment_end', models.DateTimeField(blank=True, null=True)),
('announcement', models.DateTimeField(blank=True, null=True)),
('short_description_override', models.CharField(max_length=255, default=None, help_text="Short description specific for this run of a course. Leave this value blank to default to the parent course's short_description attribute.", blank=True, null=True)),
('full_description_override', models.TextField(default=None, help_text="Full description specific for this run of a course. Leave this value blank to default to the parent course's full_description attribute.", blank=True, null=True)),
('short_description_override', models.CharField(default=None, blank=True, max_length=255, null=True, help_text="Short description specific for this run of a course. Leave this value blank to default to the parent course's short_description attribute.")),
('full_description_override', models.TextField(default=None, blank=True, help_text="Full description specific for this run of a course. Leave this value blank to default to the parent course's full_description attribute.", null=True)),
('min_effort', models.PositiveSmallIntegerField(help_text='Estimated minimum number of hours per week needed to complete a course run.', blank=True, null=True)),
('max_effort', models.PositiveSmallIntegerField(help_text='Estimated maximum number of hours per week needed to complete a course run.', blank=True, null=True)),
('pacing_type', models.CharField(max_length=255, db_index=True, choices=[('self_paced', 'Self-paced'), ('instructor_paced', 'Instructor-paced')], null=True, blank=True)),
('course', models.ForeignKey(to='course_metadata.Course', related_name='course_runs')),
('pacing_type', models.CharField(db_index=True, blank=True, max_length=255, null=True, choices=[('self_paced', 'Self-paced'), ('instructor_paced', 'Instructor-paced')])),
('course', models.ForeignKey(related_name='course_runs', to='course_metadata.Course')),
],
options={
'ordering': ('-modified', '-created'),
......@@ -88,8 +73,8 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='ExpectedLearningItem',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('value', models.CharField(max_length=255)),
],
......@@ -100,17 +85,17 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='HistoricalCourse',
fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=True)),
('title', models.CharField(max_length=255, default=None, blank=True, null=True)),
('short_description', models.CharField(max_length=255, default=None, blank=True, null=True)),
('title', models.CharField(default=None, blank=True, max_length=255, null=True)),
('short_description', models.CharField(default=None, blank=True, max_length=255, null=True)),
('full_description', models.TextField(default=None, blank=True, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])),
('history_user', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL, related_name='+')),
('history_user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='+', on_delete=django.db.models.deletion.SET_NULL, null=True)),
],
options={
'verbose_name': 'historical course',
......@@ -121,27 +106,26 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='HistoricalCourseRun',
fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=True)),
('title_override', models.CharField(max_length=255, default=None, help_text="Title specific for this run of a course. Leave this value blank to default to the parent course's title.", blank=True, null=True)),
('title_override', models.CharField(default=None, blank=True, max_length=255, null=True, help_text="Title specific for this run of a course. Leave this value blank to default to the parent course's title.")),
('start', models.DateTimeField(blank=True, null=True)),
('end', models.DateTimeField(blank=True, null=True)),
('enrollment_start', models.DateTimeField(blank=True, null=True)),
('enrollment_end', models.DateTimeField(blank=True, null=True)),
('announcement', models.DateTimeField(blank=True, null=True)),
('short_description_override', models.CharField(max_length=255, default=None, help_text="Short description specific for this run of a course. Leave this value blank to default to the parent course's short_description attribute.", blank=True, null=True)),
('full_description_override', models.TextField(default=None, help_text="Full description specific for this run of a course. Leave this value blank to default to the parent course's full_description attribute.", blank=True, null=True)),
('short_description_override', models.CharField(default=None, blank=True, max_length=255, null=True, help_text="Short description specific for this run of a course. Leave this value blank to default to the parent course's short_description attribute.")),
('full_description_override', models.TextField(default=None, blank=True, help_text="Full description specific for this run of a course. Leave this value blank to default to the parent course's full_description attribute.", null=True)),
('min_effort', models.PositiveSmallIntegerField(help_text='Estimated minimum number of hours per week needed to complete a course run.', blank=True, null=True)),
('max_effort', models.PositiveSmallIntegerField(help_text='Estimated maximum number of hours per week needed to complete a course run.', blank=True, null=True)),
('pacing_type', models.CharField(max_length=255, db_index=True, choices=[('self_paced', 'Self-paced'), ('instructor_paced', 'Instructor-paced')], null=True, blank=True)),
('pacing_type', models.CharField(db_index=True, blank=True, max_length=255, null=True, choices=[('self_paced', 'Self-paced'), ('instructor_paced', 'Instructor-paced')])),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])),
('course', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Course', blank=True, related_name='+')),
('history_user', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL, related_name='+')),
('language', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='ietf_language_tags.LanguageTag', blank=True, related_name='+')),
('course', models.ForeignKey(db_constraint=False, to='course_metadata.Course', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True)),
('history_user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='+', on_delete=django.db.models.deletion.SET_NULL, null=True)),
],
options={
'verbose_name': 'historical course run',
......@@ -152,17 +136,17 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='HistoricalOrganization',
fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=True)),
('name', models.CharField(max_length=255, blank=True, null=True)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('description', models.TextField(blank=True, null=True)),
('homepage_url', models.URLField(max_length=255, blank=True, null=True)),
('homepage_url', models.URLField(blank=True, max_length=255, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])),
('history_user', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL, related_name='+')),
('history_user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='+', on_delete=django.db.models.deletion.SET_NULL, null=True)),
],
options={
'verbose_name': 'historical organization',
......@@ -173,17 +157,17 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='HistoricalPerson',
fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=True)),
('name', models.CharField(max_length=255, blank=True, null=True)),
('title', models.CharField(max_length=255, blank=True, null=True)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('title', models.CharField(blank=True, max_length=255, null=True)),
('bio', models.TextField(blank=True, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])),
('history_user', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL, related_name='+')),
('history_user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='+', on_delete=django.db.models.deletion.SET_NULL, null=True)),
],
options={
'verbose_name': 'historical person',
......@@ -194,20 +178,20 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='HistoricalSeat',
fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('type', models.CharField(max_length=63, choices=[('honor', 'Honor'), ('audit', 'Audit'), ('verified', 'Verified'), ('professional', 'Professional'), ('credit', 'Credit')])),
('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('upgrade_deadline', models.DateTimeField(blank=True, null=True)),
('credit_provider', models.CharField(max_length=255, blank=True, null=True)),
('credit_provider', models.CharField(blank=True, max_length=255, null=True)),
('credit_hours', models.IntegerField(blank=True, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])),
('course_run', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.CourseRun', blank=True, related_name='+')),
('currency', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='core.Currency', blank=True, related_name='+')),
('history_user', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL, related_name='+')),
('course_run', models.ForeignKey(db_constraint=False, to='course_metadata.CourseRun', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True)),
('currency', models.ForeignKey(db_constraint=False, to='core.Currency', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True)),
('history_user', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='+', on_delete=django.db.models.deletion.SET_NULL, null=True)),
],
options={
'verbose_name': 'historical seat',
......@@ -216,12 +200,27 @@ class Migration(migrations.Migration):
},
),
migrations.CreateModel(
name='Image',
fields=[
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('src', models.URLField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('height', models.IntegerField(blank=True, null=True)),
('width', models.IntegerField(blank=True, null=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='LevelType',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('name', models.CharField(unique=True, max_length=255)),
('name', models.CharField(max_length=255, unique=True)),
],
options={
'abstract': False,
......@@ -230,13 +229,14 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Organization',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255)),
('name', models.CharField(max_length=255, blank=True, null=True)),
('key', models.CharField(max_length=255, unique=True)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('description', models.TextField(blank=True, null=True)),
('homepage_url', models.URLField(max_length=255, blank=True, null=True)),
('homepage_url', models.URLField(blank=True, max_length=255, null=True)),
('logo_image', models.ForeignKey(to='course_metadata.Image', blank=True, null=True)),
],
options={
'ordering': ('-modified', '-created'),
......@@ -247,14 +247,15 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Person',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255)),
('name', models.CharField(max_length=255, blank=True, null=True)),
('title', models.CharField(max_length=255, blank=True, null=True)),
('key', models.CharField(max_length=255, unique=True)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('title', models.CharField(blank=True, max_length=255, null=True)),
('bio', models.TextField(blank=True, null=True)),
('organizations', models.ManyToManyField(to='course_metadata.Organization', blank=True)),
('organizations', models.ManyToManyField(blank=True, to='course_metadata.Organization')),
('profile_image', models.ForeignKey(to='course_metadata.Image', blank=True, null=True)),
],
options={
'verbose_name_plural': 'People',
......@@ -263,10 +264,10 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Prerequisite',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('name', models.CharField(unique=True, max_length=255)),
('name', models.CharField(max_length=255, unique=True)),
],
options={
'abstract': False,
......@@ -275,25 +276,25 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Seat',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('type', models.CharField(max_length=63, choices=[('honor', 'Honor'), ('audit', 'Audit'), ('verified', 'Verified'), ('professional', 'Professional'), ('credit', 'Credit')])),
('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('upgrade_deadline', models.DateTimeField(blank=True, null=True)),
('credit_provider', models.CharField(max_length=255, blank=True, null=True)),
('credit_provider', models.CharField(blank=True, max_length=255, null=True)),
('credit_hours', models.IntegerField(blank=True, null=True)),
('course_run', models.ForeignKey(to='course_metadata.CourseRun', related_name='seats')),
('course_run', models.ForeignKey(related_name='seats', to='course_metadata.CourseRun')),
('currency', models.ForeignKey(to='core.Currency')),
],
),
migrations.CreateModel(
name='Subject',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('name', models.CharField(unique=True, max_length=255)),
('name', models.CharField(max_length=255, unique=True)),
],
options={
'abstract': False,
......@@ -302,77 +303,109 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='SyllabusItem',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('value', models.CharField(max_length=255)),
('parent', models.ForeignKey(null=True, to='course_metadata.SyllabusItem', blank=True, related_name='children')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Image',
fields=[
('abstractmediamodel_ptr', models.OneToOneField(auto_created=True, to='course_metadata.AbstractMediaModel', serialize=False, parent_link=True, primary_key=True)),
('height', models.IntegerField(blank=True, null=True)),
('width', models.IntegerField(blank=True, null=True)),
('parent', models.ForeignKey(to='course_metadata.SyllabusItem', blank=True, related_name='children', null=True)),
],
options={
'ordering': ('-modified', '-created'),
'get_latest_by': 'modified',
'abstract': False,
},
bases=('course_metadata.abstractmediamodel',),
),
migrations.CreateModel(
name='Video',
fields=[
('abstractmediamodel_ptr', models.OneToOneField(auto_created=True, to='course_metadata.AbstractMediaModel', serialize=False, parent_link=True, primary_key=True)),
('image', models.ForeignKey(null=True, to='course_metadata.Image', blank=True)),
('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('src', models.URLField(max_length=255, unique=True)),
('description', models.CharField(blank=True, max_length=255, null=True)),
('image', models.ForeignKey(to='course_metadata.Image', blank=True, null=True)),
],
options={
'ordering': ('-modified', '-created'),
'get_latest_by': 'modified',
'abstract': False,
},
bases=('course_metadata.abstractmediamodel',),
),
migrations.AddField(
model_name='historicalperson',
name='profile_image',
field=models.ForeignKey(db_constraint=False, to='course_metadata.Image', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalorganization',
name='logo_image',
field=models.ForeignKey(db_constraint=False, to='course_metadata.Image', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourserun',
name='image',
field=models.ForeignKey(db_constraint=False, to='course_metadata.Image', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourserun',
name='language',
field=models.ForeignKey(db_constraint=False, to='ietf_language_tags.LanguageTag', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourserun',
name='syllabus',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.SyllabusItem', blank=True, related_name='+'),
field=models.ForeignKey(db_constraint=False, to='course_metadata.SyllabusItem', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourserun',
name='video',
field=models.ForeignKey(db_constraint=False, to='course_metadata.Video', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourse',
name='image',
field=models.ForeignKey(db_constraint=False, to='course_metadata.Image', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourse',
name='level_type',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.LevelType', blank=True, related_name='+'),
field=models.ForeignKey(db_constraint=False, to='course_metadata.LevelType', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='historicalcourse',
name='video',
field=models.ForeignKey(db_constraint=False, to='course_metadata.Video', blank=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, null=True),
),
migrations.AddField(
model_name='courserun',
name='image',
field=models.ForeignKey(default=None, to='course_metadata.Image', blank=True, null=True),
),
migrations.AddField(
model_name='courserun',
name='instructors',
field=sortedm2m.fields.SortedManyToManyField(to='course_metadata.Person', help_text=None, blank=True, related_name='courses_instructed'),
field=sortedm2m.fields.SortedManyToManyField(help_text=None, blank=True, related_name='courses_instructed', to='course_metadata.Person'),
),
migrations.AddField(
model_name='courserun',
name='language',
field=models.ForeignKey(null=True, to='ietf_language_tags.LanguageTag', blank=True),
field=models.ForeignKey(to='ietf_language_tags.LanguageTag', blank=True, null=True),
),
migrations.AddField(
model_name='courserun',
name='staff',
field=sortedm2m.fields.SortedManyToManyField(to='course_metadata.Person', help_text=None, blank=True, related_name='courses_staffed'),
field=sortedm2m.fields.SortedManyToManyField(help_text=None, blank=True, related_name='courses_staffed', to='course_metadata.Person'),
),
migrations.AddField(
model_name='courserun',
name='syllabus',
field=models.ForeignKey(null=True, to='course_metadata.SyllabusItem', default=None, blank=True),
field=models.ForeignKey(default=None, to='course_metadata.SyllabusItem', blank=True, null=True),
),
migrations.AddField(
model_name='courserun',
name='transcript_languages',
field=models.ManyToManyField(to='ietf_language_tags.LanguageTag', blank=True, related_name='transcript_courses'),
field=models.ManyToManyField(blank=True, related_name='transcript_courses', to='ietf_language_tags.LanguageTag'),
),
migrations.AddField(
model_name='courserun',
name='video',
field=models.ForeignKey(default=None, to='course_metadata.Video', blank=True, null=True),
),
migrations.AddField(
model_name='courseorganization',
......@@ -382,81 +415,41 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='course',
name='expected_learning_items',
field=sortedm2m.fields.SortedManyToManyField(to='course_metadata.ExpectedLearningItem', help_text=None, blank=True),
field=sortedm2m.fields.SortedManyToManyField(help_text=None, blank=True, to='course_metadata.ExpectedLearningItem'),
),
migrations.AddField(
model_name='course',
name='image',
field=models.ForeignKey(default=None, to='course_metadata.Image', blank=True, null=True),
),
migrations.AddField(
model_name='course',
name='level_type',
field=models.ForeignKey(null=True, to='course_metadata.LevelType', default=None, blank=True),
field=models.ForeignKey(default=None, to='course_metadata.LevelType', blank=True, null=True),
),
migrations.AddField(
model_name='course',
name='organizations',
field=models.ManyToManyField(to='course_metadata.Organization', blank=True, through='course_metadata.CourseOrganization'),
field=models.ManyToManyField(blank=True, through='course_metadata.CourseOrganization', to='course_metadata.Organization'),
),
migrations.AddField(
model_name='course',
name='prerequisites',
field=models.ManyToManyField(to='course_metadata.Prerequisite', blank=True),
field=models.ManyToManyField(blank=True, to='course_metadata.Prerequisite'),
),
migrations.AddField(
model_name='course',
name='subjects',
field=models.ManyToManyField(to='course_metadata.Subject', blank=True),
),
migrations.AlterUniqueTogether(
name='seat',
unique_together=set([('course_run', 'type', 'currency', 'credit_provider')]),
),
migrations.AddField(
model_name='person',
name='profile_image',
field=models.ForeignKey(null=True, to='course_metadata.Image', blank=True),
),
migrations.AddField(
model_name='organization',
name='logo_image',
field=models.ForeignKey(null=True, to='course_metadata.Image', blank=True),
),
migrations.AddField(
model_name='historicalperson',
name='profile_image',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Image', blank=True, related_name='+'),
),
migrations.AddField(
model_name='historicalorganization',
name='logo_image',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Image', blank=True, related_name='+'),
),
migrations.AddField(
model_name='historicalcourserun',
name='image',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Image', blank=True, related_name='+'),
),
migrations.AddField(
model_name='historicalcourserun',
name='video',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Video', blank=True, related_name='+'),
field=models.ManyToManyField(blank=True, to='course_metadata.Subject'),
),
migrations.AddField(
model_name='historicalcourse',
name='image',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Image', blank=True, related_name='+'),
),
migrations.AddField(
model_name='historicalcourse',
model_name='course',
name='video',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='course_metadata.Video', blank=True, related_name='+'),
field=models.ForeignKey(default=None, to='course_metadata.Video', blank=True, null=True),
),
migrations.AddField(
model_name='courserun',
name='image',
field=models.ForeignKey(null=True, to='course_metadata.Image', default=None, blank=True),
),
migrations.AddField(
model_name='courserun',
name='video',
field=models.ForeignKey(null=True, to='course_metadata.Video', default=None, blank=True),
migrations.AlterUniqueTogether(
name='seat',
unique_together=set([('course_run', 'type', 'currency', 'credit_provider')]),
),
migrations.AlterUniqueTogether(
name='courseorganization',
......@@ -466,14 +459,4 @@ class Migration(migrations.Migration):
name='courseorganization',
index_together=set([('course', 'relation_type')]),
),
migrations.AddField(
model_name='course',
name='image',
field=models.ForeignKey(null=True, to='course_metadata.Image', default=None, blank=True),
),
migrations.AddField(
model_name='course',
name='video',
field=models.ForeignKey(null=True, to='course_metadata.Video', default=None, blank=True),
),
]
......@@ -42,6 +42,9 @@ class AbstractMediaModel(TimeStampedModel):
def __str__(self):
return self.src
class Meta(object):
abstract = True
class Image(AbstractMediaModel):
""" Image model. """
......
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