Commit c7d0af60 by Clinton Blackburn

Merge pull request #57 from edx/clintonb/abstract-model-fix

Fixed abstract model declaration
parents 82ce9b92 70af296f
...@@ -3,44 +3,29 @@ from __future__ import unicode_literals ...@@ -3,44 +3,29 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django_extensions.db.fields import django_extensions.db.fields
from django.conf import settings
import sortedm2m.fields
import django.db.models.deletion import django.db.models.deletion
import sortedm2m.fields
from django.conf import settings
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('core', '0005_populate_currencies'), ('core', '0005_populate_currencies'),
('ietf_language_tags', '0002_language_tag_data_migration'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL), migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('ietf_language_tags', '0002_language_tag_data_migration'),
] ]
operations = [ operations = [
migrations.CreateModel( 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', name='Course',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255, db_index=True)), ('key', models.CharField(db_index=True, max_length=255, unique=True)),
('title', 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(max_length=255, default=None, blank=True, 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)), ('full_description', models.TextField(default=None, blank=True, null=True)),
], ],
options={ options={
...@@ -52,8 +37,8 @@ class Migration(migrations.Migration): ...@@ -52,8 +37,8 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='CourseOrganization', name='CourseOrganization',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('relation_type', models.CharField(max_length=63, choices=[('owner', 'Owner'), ('sponsor', 'Sponsor')])), ('relation_type', models.CharField(max_length=63, choices=[('owner', 'Owner'), ('sponsor', 'Sponsor')])),
('course', models.ForeignKey(to='course_metadata.Course')), ('course', models.ForeignKey(to='course_metadata.Course')),
...@@ -62,22 +47,22 @@ class Migration(migrations.Migration): ...@@ -62,22 +47,22 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='CourseRun', name='CourseRun',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255)), ('key', models.CharField(max_length=255, unique=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)), ('start', models.DateTimeField(blank=True, null=True)),
('end', models.DateTimeField(blank=True, null=True)), ('end', models.DateTimeField(blank=True, null=True)),
('enrollment_start', models.DateTimeField(blank=True, null=True)), ('enrollment_start', models.DateTimeField(blank=True, null=True)),
('enrollment_end', models.DateTimeField(blank=True, null=True)), ('enrollment_end', models.DateTimeField(blank=True, null=True)),
('announcement', 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)), ('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, 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)), ('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)), ('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)), ('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')])),
('course', models.ForeignKey(to='course_metadata.Course', related_name='course_runs')), ('course', models.ForeignKey(related_name='course_runs', to='course_metadata.Course')),
], ],
options={ options={
'ordering': ('-modified', '-created'), 'ordering': ('-modified', '-created'),
...@@ -88,8 +73,8 @@ class Migration(migrations.Migration): ...@@ -88,8 +73,8 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='ExpectedLearningItem', name='ExpectedLearningItem',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('value', models.CharField(max_length=255)), ('value', models.CharField(max_length=255)),
], ],
...@@ -100,17 +85,17 @@ class Migration(migrations.Migration): ...@@ -100,17 +85,17 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='HistoricalCourse', name='HistoricalCourse',
fields=[ fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)), ('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=True)), ('key', models.CharField(max_length=255, db_index=True)),
('title', 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(max_length=255, default=None, blank=True, 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)), ('full_description', models.TextField(default=None, blank=True, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()), ('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('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={ options={
'verbose_name': 'historical course', 'verbose_name': 'historical course',
...@@ -121,27 +106,26 @@ class Migration(migrations.Migration): ...@@ -121,27 +106,26 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='HistoricalCourseRun', name='HistoricalCourseRun',
fields=[ fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)), ('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=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)), ('start', models.DateTimeField(blank=True, null=True)),
('end', models.DateTimeField(blank=True, null=True)), ('end', models.DateTimeField(blank=True, null=True)),
('enrollment_start', models.DateTimeField(blank=True, null=True)), ('enrollment_start', models.DateTimeField(blank=True, null=True)),
('enrollment_end', models.DateTimeField(blank=True, null=True)), ('enrollment_end', models.DateTimeField(blank=True, null=True)),
('announcement', 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)), ('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, 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)), ('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)), ('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)), ('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_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()), ('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('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='+')), ('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(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)),
('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='+')),
], ],
options={ options={
'verbose_name': 'historical course run', 'verbose_name': 'historical course run',
...@@ -152,17 +136,17 @@ class Migration(migrations.Migration): ...@@ -152,17 +136,17 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='HistoricalOrganization', name='HistoricalOrganization',
fields=[ fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)), ('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=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)), ('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_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()), ('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('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={ options={
'verbose_name': 'historical organization', 'verbose_name': 'historical organization',
...@@ -173,17 +157,17 @@ class Migration(migrations.Migration): ...@@ -173,17 +157,17 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='HistoricalPerson', name='HistoricalPerson',
fields=[ fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)), ('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(max_length=255, db_index=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)),
('title', models.CharField(max_length=255, blank=True, null=True)), ('title', models.CharField(blank=True, max_length=255, null=True)),
('bio', models.TextField(blank=True, null=True)), ('bio', models.TextField(blank=True, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()), ('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('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={ options={
'verbose_name': 'historical person', 'verbose_name': 'historical person',
...@@ -194,20 +178,20 @@ class Migration(migrations.Migration): ...@@ -194,20 +178,20 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='HistoricalSeat', name='HistoricalSeat',
fields=[ fields=[
('id', models.IntegerField(verbose_name='ID', db_index=True, blank=True, auto_created=True)), ('id', models.IntegerField(auto_created=True, blank=True, verbose_name='ID', db_index=True)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('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')])), ('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)), ('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('upgrade_deadline', models.DateTimeField(blank=True, null=True)), ('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)), ('credit_hours', models.IntegerField(blank=True, null=True)),
('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()), ('history_date', models.DateTimeField()),
('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('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='+')), ('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, on_delete=django.db.models.deletion.DO_NOTHING, null=True, to='core.Currency', blank=True, related_name='+')), ('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(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={ options={
'verbose_name': 'historical seat', 'verbose_name': 'historical seat',
...@@ -216,12 +200,27 @@ class Migration(migrations.Migration): ...@@ -216,12 +200,27 @@ class Migration(migrations.Migration):
}, },
), ),
migrations.CreateModel( 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', name='LevelType',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('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={ options={
'abstract': False, 'abstract': False,
...@@ -230,13 +229,14 @@ class Migration(migrations.Migration): ...@@ -230,13 +229,14 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Organization', name='Organization',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255)), ('key', models.CharField(max_length=255, unique=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)), ('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={ options={
'ordering': ('-modified', '-created'), 'ordering': ('-modified', '-created'),
...@@ -247,14 +247,15 @@ class Migration(migrations.Migration): ...@@ -247,14 +247,15 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Person', name='Person',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('key', models.CharField(unique=True, max_length=255)), ('key', models.CharField(max_length=255, unique=True)),
('name', models.CharField(max_length=255, blank=True, null=True)), ('name', models.CharField(blank=True, max_length=255, null=True)),
('title', models.CharField(max_length=255, blank=True, null=True)), ('title', models.CharField(blank=True, max_length=255, null=True)),
('bio', models.TextField(blank=True, 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={ options={
'verbose_name_plural': 'People', 'verbose_name_plural': 'People',
...@@ -263,10 +264,10 @@ class Migration(migrations.Migration): ...@@ -263,10 +264,10 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Prerequisite', name='Prerequisite',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('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={ options={
'abstract': False, 'abstract': False,
...@@ -275,25 +276,25 @@ class Migration(migrations.Migration): ...@@ -275,25 +276,25 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Seat', name='Seat',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('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')])), ('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)), ('price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('upgrade_deadline', models.DateTimeField(blank=True, null=True)), ('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)), ('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')), ('currency', models.ForeignKey(to='core.Currency')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Subject', name='Subject',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('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={ options={
'abstract': False, 'abstract': False,
...@@ -302,77 +303,109 @@ class Migration(migrations.Migration): ...@@ -302,77 +303,109 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='SyllabusItem', name='SyllabusItem',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('created', django_extensions.db.fields.CreationDateTimeField(verbose_name='created', auto_now_add=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)), ('modified', django_extensions.db.fields.ModificationDateTimeField(verbose_name='modified', auto_now=True)),
('value', models.CharField(max_length=255)), ('value', models.CharField(max_length=255)),
('parent', models.ForeignKey(null=True, to='course_metadata.SyllabusItem', blank=True, related_name='children')), ('parent', models.ForeignKey(to='course_metadata.SyllabusItem', blank=True, related_name='children', null=True)),
],
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)),
], ],
options={ options={
'ordering': ('-modified', '-created'),
'get_latest_by': 'modified',
'abstract': False, 'abstract': False,
}, },
bases=('course_metadata.abstractmediamodel',),
), ),
migrations.CreateModel( migrations.CreateModel(
name='Video', name='Video',
fields=[ fields=[
('abstractmediamodel_ptr', models.OneToOneField(auto_created=True, to='course_metadata.AbstractMediaModel', serialize=False, parent_link=True, primary_key=True)), ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)),
('image', models.ForeignKey(null=True, to='course_metadata.Image', blank=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)),
('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={ options={
'ordering': ('-modified', '-created'),
'get_latest_by': 'modified',
'abstract': False, '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( migrations.AddField(
model_name='historicalcourserun', model_name='historicalcourserun',
name='syllabus', 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( migrations.AddField(
model_name='historicalcourse', model_name='historicalcourse',
name='level_type', 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( migrations.AddField(
model_name='courserun', model_name='courserun',
name='instructors', 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( migrations.AddField(
model_name='courserun', model_name='courserun',
name='language', 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( migrations.AddField(
model_name='courserun', model_name='courserun',
name='staff', 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( migrations.AddField(
model_name='courserun', model_name='courserun',
name='syllabus', 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( migrations.AddField(
model_name='courserun', model_name='courserun',
name='transcript_languages', 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( migrations.AddField(
model_name='courseorganization', model_name='courseorganization',
...@@ -382,81 +415,41 @@ class Migration(migrations.Migration): ...@@ -382,81 +415,41 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='course', model_name='course',
name='expected_learning_items', 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( migrations.AddField(
model_name='course', model_name='course',
name='level_type', 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( migrations.AddField(
model_name='course', model_name='course',
name='organizations', 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( migrations.AddField(
model_name='course', model_name='course',
name='prerequisites', name='prerequisites',
field=models.ManyToManyField(to='course_metadata.Prerequisite', blank=True), field=models.ManyToManyField(blank=True, to='course_metadata.Prerequisite'),
), ),
migrations.AddField( migrations.AddField(
model_name='course', model_name='course',
name='subjects', name='subjects',
field=models.ManyToManyField(to='course_metadata.Subject', blank=True), field=models.ManyToManyField(blank=True, to='course_metadata.Subject'),
),
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='+'),
), ),
migrations.AddField( migrations.AddField(
model_name='historicalcourse', model_name='course',
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',
name='video', 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( migrations.AlterUniqueTogether(
model_name='courserun', name='seat',
name='image', unique_together=set([('course_run', 'type', 'currency', 'credit_provider')]),
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( migrations.AlterUniqueTogether(
name='courseorganization', name='courseorganization',
...@@ -466,14 +459,4 @@ class Migration(migrations.Migration): ...@@ -466,14 +459,4 @@ class Migration(migrations.Migration):
name='courseorganization', name='courseorganization',
index_together=set([('course', 'relation_type')]), 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): ...@@ -42,6 +42,9 @@ class AbstractMediaModel(TimeStampedModel):
def __str__(self): def __str__(self):
return self.src return self.src
class Meta(object):
abstract = True
class Image(AbstractMediaModel): class Image(AbstractMediaModel):
""" Image model. """ """ 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