Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
3f58954f
Commit
3f58954f
authored
Feb 09, 2016
by
John Eskew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11469 from edx/jeskew/fix_django_19_warnings
Remove deprecation warnings from Django models.
parents
84773d2f
bb5c28c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
1 deletions
+39
-1
common/djangoapps/course_modes/migrations/0006_auto_20160208_1407.py
+18
-0
common/djangoapps/course_modes/models.py
+9
-0
lms/djangoapps/certificates/models.py
+9
-1
lms/djangoapps/instructor_task/models.py
+3
-0
No files found.
common/djangoapps/course_modes/migrations/0006_auto_20160208_1407.py
0 → 100644
View file @
3f58954f
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'course_modes'
,
'0005_auto_20151217_0958'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'coursemodeexpirationconfig'
,
options
=
{},
),
]
common/djangoapps/course_modes/models.py
View file @
3f58954f
...
@@ -30,6 +30,9 @@ class CourseMode(models.Model):
...
@@ -30,6 +30,9 @@ class CourseMode(models.Model):
We would like to offer a course in a variety of modes.
We would like to offer a course in a variety of modes.
"""
"""
class
Meta
(
object
):
app_label
=
"course_modes"
# the course that this mode is attached to
# the course that this mode is attached to
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
,
verbose_name
=
_
(
"Course"
))
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
,
verbose_name
=
_
(
"Course"
))
...
@@ -636,6 +639,9 @@ class CourseModesArchive(models.Model):
...
@@ -636,6 +639,9 @@ class CourseModesArchive(models.Model):
field pair in CourseModes. Having a separate table allows us to have an audit trail of any changes
field pair in CourseModes. Having a separate table allows us to have an audit trail of any changes
such as course price changes
such as course price changes
"""
"""
class
Meta
(
object
):
app_label
=
"course_modes"
# the course that this mode is attached to
# the course that this mode is attached to
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
...
@@ -665,6 +671,9 @@ class CourseModeExpirationConfig(ConfigurationModel):
...
@@ -665,6 +671,9 @@ class CourseModeExpirationConfig(ConfigurationModel):
"""
"""
Configuration for time period from end of course to auto-expire a course mode.
Configuration for time period from end of course to auto-expire a course mode.
"""
"""
class
Meta
(
object
):
app_label
=
"course_modes"
verification_window
=
models
.
DurationField
(
verification_window
=
models
.
DurationField
(
default
=
timedelta
(
days
=
10
),
default
=
timedelta
(
days
=
10
),
help_text
=
_
(
help_text
=
_
(
...
...
lms/djangoapps/certificates/models.py
View file @
3f58954f
...
@@ -65,7 +65,6 @@ from model_utils.models import TimeStampedModel
...
@@ -65,7 +65,6 @@ from model_utils.models import TimeStampedModel
from
openedx.core.djangoapps.signals.signals
import
COURSE_CERT_AWARDED
from
openedx.core.djangoapps.signals.signals
import
COURSE_CERT_AWARDED
from
config_models.models
import
ConfigurationModel
from
config_models.models
import
ConfigurationModel
from
course_modes.models
import
CourseMode
from
instructor_task.models
import
InstructorTask
from
instructor_task.models
import
InstructorTask
from
util.milestones_helpers
import
fulfill_course_milestone
,
is_prerequisite_courses_enabled
from
util.milestones_helpers
import
fulfill_course_milestone
,
is_prerequisite_courses_enabled
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
...
@@ -206,6 +205,9 @@ class GeneratedCertificate(models.Model):
...
@@ -206,6 +205,9 @@ class GeneratedCertificate(models.Model):
"""
"""
Base model for generated certificates
Base model for generated certificates
"""
"""
# Import here instead of top of file since this module gets imported before
# the course_modes app is loaded, resulting in a Django deprecation warning.
from
course_modes.models
import
CourseMode
# Only returns eligible certificates. This should be used in
# Only returns eligible certificates. This should be used in
# preference to the default `objects` manager in most cases.
# preference to the default `objects` manager in most cases.
...
@@ -463,6 +465,9 @@ def certificate_status_for_student(student, course_id):
...
@@ -463,6 +465,9 @@ def certificate_status_for_student(student, course_id):
If the student has been graded, the dictionary also contains their
If the student has been graded, the dictionary also contains their
grade for the course with the key "grade".
grade for the course with the key "grade".
'''
'''
# Import here instead of top of file since this module gets imported before
# the course_modes app is loaded, resulting in a Django deprecation warning.
from
course_modes.models
import
CourseMode
try
:
try
:
generated_certificate
=
GeneratedCertificate
.
objects
.
get
(
# pylint: disable=no-member
generated_certificate
=
GeneratedCertificate
.
objects
.
get
(
# pylint: disable=no-member
...
@@ -545,6 +550,9 @@ class ExampleCertificateSet(TimeStampedModel):
...
@@ -545,6 +550,9 @@ class ExampleCertificateSet(TimeStampedModel):
ExampleCertificateSet
ExampleCertificateSet
"""
"""
# Import here instead of top of file since this module gets imported before
# the course_modes app is loaded, resulting in a Django deprecation warning.
from
course_modes.models
import
CourseMode
cert_set
=
cls
.
objects
.
create
(
course_key
=
course_key
)
cert_set
=
cls
.
objects
.
create
(
course_key
=
course_key
)
ExampleCertificate
.
objects
.
bulk_create
([
ExampleCertificate
.
objects
.
bulk_create
([
...
...
lms/djangoapps/instructor_task/models.py
View file @
3f58954f
...
@@ -58,6 +58,9 @@ class InstructorTask(models.Model):
...
@@ -58,6 +58,9 @@ class InstructorTask(models.Model):
`created` stores date that entry was first created
`created` stores date that entry was first created
`updated` stores date that entry was last modified
`updated` stores date that entry was last modified
"""
"""
class
Meta
(
object
):
app_label
=
"instructor_task"
task_type
=
models
.
CharField
(
max_length
=
50
,
db_index
=
True
)
task_type
=
models
.
CharField
(
max_length
=
50
,
db_index
=
True
)
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
task_key
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
)
task_key
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
)
...
...
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