Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
94cc894d
Commit
94cc894d
authored
Apr 23, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hotfix: mentoring and problem_builder should not both use the same db table
parent
4817f9d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletions
+46
-1
problem_builder/models.py
+2
-1
problem_builder/south_migrations/0001_initial.py
+44
-0
problem_builder/south_migrations/__init__.py
+0
-0
No files found.
problem_builder/models.py
View file @
94cc894d
...
@@ -29,10 +29,11 @@ class Answer(models.Model):
...
@@ -29,10 +29,11 @@ class Answer(models.Model):
"""
"""
Django model used to store AnswerBlock data that need to be shared
Django model used to store AnswerBlock data that need to be shared
and queried accross XBlock instances (workaround).
and queried accross XBlock instances (workaround).
TODO: Deprecate this and move to edx-submissions
"""
"""
class
Meta
:
class
Meta
:
db_table
=
'mentoring_answer'
unique_together
=
((
'student_id'
,
'course_id'
,
'name'
),)
unique_together
=
((
'student_id'
,
'course_id'
,
'name'
),)
name
=
models
.
CharField
(
max_length
=
50
,
db_index
=
True
)
name
=
models
.
CharField
(
max_length
=
50
,
db_index
=
True
)
...
...
problem_builder/south_migrations/0001_initial.py
0 → 100644
View file @
94cc894d
# -*- coding: utf-8 -*-
from
south.db
import
db
from
south.v2
import
SchemaMigration
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Adding model 'Answer'
db
.
create_table
(
'problem_builder_answer'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'name'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
50
,
db_index
=
True
)),
(
'student_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
32
,
db_index
=
True
)),
(
'course_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
50
,
db_index
=
True
)),
(
'student_input'
,
self
.
gf
(
'django.db.models.fields.TextField'
)(
default
=
''
,
blank
=
True
)),
(
'created_on'
,
self
.
gf
(
'django.db.models.fields.DateTimeField'
)(
auto_now_add
=
True
,
blank
=
True
)),
(
'modified_on'
,
self
.
gf
(
'django.db.models.fields.DateTimeField'
)(
auto_now
=
True
,
blank
=
True
)),
))
db
.
send_create_signal
(
'problem_builder'
,
[
'Answer'
])
# Adding unique constraint on 'Answer', fields ['student_id', 'course_id', 'name']
db
.
create_unique
(
'problem_builder_answer'
,
[
'student_id'
,
'course_id'
,
'name'
])
def
backwards
(
self
,
orm
):
# Removing unique constraint on 'Answer', fields ['student_id', 'course_id', 'name']
db
.
delete_unique
(
'problem_builder_answer'
,
[
'student_id'
,
'course_id'
,
'name'
])
# Deleting model 'Answer'
db
.
delete_table
(
'problem_builder_answer'
)
models
=
{
'problem_builder.answer'
:
{
'Meta'
:
{
'unique_together'
:
"(('student_id', 'course_id', 'name'),)"
,
'object_name'
:
'Answer'
},
'course_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'50'
,
'db_index'
:
'True'
}),
'created_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'True'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'modified_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now'
:
'True'
,
'blank'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'50'
,
'db_index'
:
'True'
}),
'student_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'32'
,
'db_index'
:
'True'
}),
'student_input'
:
(
'django.db.models.fields.TextField'
,
[],
{
'default'
:
"''"
,
'blank'
:
'True'
})
}
}
complete_apps
=
[
'problem_builder'
]
problem_builder/south_migrations/__init__.py
0 → 100644
View file @
94cc894d
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