Commit 4eed737e by muhammad-ammar Committed by Ned Batchelder

update migrations

remove deprecation warnings
parent 0a5cdc13
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.db import migrations, models
import jsonfield.fields
import submissions.models
import django.utils.timezone
import django_extensions.db.fields
......@@ -24,6 +25,16 @@ class Migration(migrations.Migration):
],
),
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',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
......@@ -38,7 +49,7 @@ class Migration(migrations.Migration):
name='StudentItem',
fields=[
('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)),
('item_id', models.CharField(max_length=255, db_index=True)),
('item_type', models.CharField(max_length=100)),
......@@ -66,7 +77,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='scoresummary',
name='student_item',
field=models.ForeignKey(to='submissions.StudentItem', unique=True),
field=models.OneToOneField(to='submissions.StudentItem'),
),
migrations.AddField(
model_name='score',
......
......@@ -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
need to then generate a matching migration for it using:
./manage.py schemamigration submissions --auto
./manage.py makemigrations submissions
"""
import logging
......@@ -21,6 +21,7 @@ from jsonfield import JSONField
logger = logging.getLogger(__name__)
# Signal to inform listeners that a score has been changed
score_set = Signal(providing_args=[
'points_possible', 'points_earned', 'anonymous_user_id',
......@@ -232,7 +233,7 @@ class Score(models.Model):
class ScoreSummary(models.Model):
"""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="+")
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