Commit 4eed737e by muhammad-ammar Committed by Ned Batchelder

update migrations

remove deprecation warnings
parent 0a5cdc13
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import models, migrations from django.db import migrations, models
import jsonfield.fields import jsonfield.fields
import submissions.models
import django.utils.timezone import django.utils.timezone
import django_extensions.db.fields import django_extensions.db.fields
...@@ -24,6 +25,16 @@ class Migration(migrations.Migration): ...@@ -24,6 +25,16 @@ class Migration(migrations.Migration):
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='ScoreAnnotation',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('annotation_type', models.CharField(max_length=255, db_index=True)),
('creator', submissions.models.AnonymizedUserIDField()),
('reason', models.TextField()),
('score', models.ForeignKey(to='submissions.Score')),
],
),
migrations.CreateModel(
name='ScoreSummary', name='ScoreSummary',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
...@@ -38,7 +49,7 @@ class Migration(migrations.Migration): ...@@ -38,7 +49,7 @@ class Migration(migrations.Migration):
name='StudentItem', name='StudentItem',
fields=[ fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('student_id', models.CharField(max_length=255, db_index=True)), ('student_id', submissions.models.AnonymizedUserIDField()),
('course_id', models.CharField(max_length=255, db_index=True)), ('course_id', models.CharField(max_length=255, db_index=True)),
('item_id', models.CharField(max_length=255, db_index=True)), ('item_id', models.CharField(max_length=255, db_index=True)),
('item_type', models.CharField(max_length=100)), ('item_type', models.CharField(max_length=100)),
...@@ -66,7 +77,7 @@ class Migration(migrations.Migration): ...@@ -66,7 +77,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='scoresummary', model_name='scoresummary',
name='student_item', name='student_item',
field=models.ForeignKey(to='submissions.StudentItem', unique=True), field=models.OneToOneField(to='submissions.StudentItem'),
), ),
migrations.AddField( migrations.AddField(
model_name='score', model_name='score',
......
...@@ -6,7 +6,7 @@ different problem types, and is therefore ignorant of ORA workflow. ...@@ -6,7 +6,7 @@ different problem types, and is therefore ignorant of ORA workflow.
NOTE: We've switched to migrations, so if you make any edits to this file, you NOTE: We've switched to migrations, so if you make any edits to this file, you
need to then generate a matching migration for it using: need to then generate a matching migration for it using:
./manage.py schemamigration submissions --auto ./manage.py makemigrations submissions
""" """
import logging import logging
...@@ -21,6 +21,7 @@ from jsonfield import JSONField ...@@ -21,6 +21,7 @@ from jsonfield import JSONField
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# Signal to inform listeners that a score has been changed # Signal to inform listeners that a score has been changed
score_set = Signal(providing_args=[ score_set = Signal(providing_args=[
'points_possible', 'points_earned', 'anonymous_user_id', 'points_possible', 'points_earned', 'anonymous_user_id',
...@@ -232,7 +233,7 @@ class Score(models.Model): ...@@ -232,7 +233,7 @@ class Score(models.Model):
class ScoreSummary(models.Model): class ScoreSummary(models.Model):
"""Running store of the highest and most recent Scores for a StudentItem.""" """Running store of the highest and most recent Scores for a StudentItem."""
student_item = models.ForeignKey(StudentItem, unique=True) student_item = models.OneToOneField(StudentItem)
highest = models.ForeignKey(Score, related_name="+") highest = models.ForeignKey(Score, related_name="+")
latest = models.ForeignKey(Score, related_name="+") latest = models.ForeignKey(Score, related_name="+")
......
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