Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-submissions
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-submissions
Commits
4eed737e
Commit
4eed737e
authored
Nov 04, 2015
by
muhammad-ammar
Committed by
Ned Batchelder
Nov 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update migrations
remove deprecation warnings
parent
0a5cdc13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
submissions/migrations/0001_initial.py
+14
-3
submissions/models.py
+3
-2
No files found.
submissions/migrations/0001_initial.py
View file @
4eed737e
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.db
import
m
odels
,
migration
s
from
django.db
import
m
igrations
,
model
s
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'
,
...
...
submissions/models.py
View file @
4eed737e
...
@@ -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
=
"+"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment