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
180cf299
Commit
180cf299
authored
Feb 01, 2017
by
Hasnain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added instructor info in course overview.
parent
576f6755
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletions
+45
-1
openedx/core/djangoapps/content/course_overviews/migrations/0011_courseoverview_instructor_info.py
+20
-0
openedx/core/djangoapps/content/course_overviews/models.py
+4
-1
openedx/core/djangoapps/content/course_overviews/tests.py
+21
-0
No files found.
openedx/core/djangoapps/content/course_overviews/migrations/0011_courseoverview_instructor_info.py
0 → 100644
View file @
180cf299
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
jsonfield.fields
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'course_overviews'
,
'0010_auto_20160329_2317'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'courseoverview'
,
name
=
'instructor_info'
,
field
=
jsonfield
.
fields
.
JSONField
(
default
=
{}),
),
]
openedx/core/djangoapps/content/course_overviews/models.py
View file @
180cf299
...
...
@@ -12,6 +12,7 @@ from django.template import defaultfilters
from
ccx_keys.locator
import
CCXLocator
from
model_utils.models
import
TimeStampedModel
from
jsonfield.fields
import
JSONField
from
opaque_keys.edx.keys
import
CourseKey
from
config_models.models
import
ConfigurationModel
...
...
@@ -43,7 +44,7 @@ class CourseOverview(TimeStampedModel):
app_label
=
'course_overviews'
# IMPORTANT: Bump this whenever you modify this model and/or add a migration.
VERSION
=
4
VERSION
=
5
# Cache entry versioning.
version
=
IntegerField
()
...
...
@@ -97,6 +98,7 @@ class CourseOverview(TimeStampedModel):
course_video_url
=
TextField
(
null
=
True
)
effort
=
TextField
(
null
=
True
)
self_paced
=
BooleanField
(
default
=
False
)
instructor_info
=
JSONField
(
null
=
False
,
blank
=
False
,
default
=
{})
@classmethod
def
_create_from_course
(
cls
,
course
):
...
...
@@ -181,6 +183,7 @@ class CourseOverview(TimeStampedModel):
effort
=
CourseDetails
.
fetch_about_attribute
(
course
.
id
,
'effort'
),
course_video_url
=
CourseDetails
.
fetch_video_url
(
course
.
id
),
self_paced
=
course
.
self_paced
,
instructor_info
=
course
.
instructor_info
,
)
@classmethod
...
...
openedx/core/djangoapps/content/course_overviews/tests.py
View file @
180cf299
...
...
@@ -113,6 +113,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
'invitation_only'
,
'max_student_enrollments_allowed'
,
'catalog_visibility'
,
'instructor_info'
]
for
attribute_name
in
fields_to_test
:
course_value
=
getattr
(
course
,
attribute_name
)
...
...
@@ -203,6 +204,24 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
],
"static_asset_path"
:
"/my/abs/path"
,
# Absolute path
"certificates_show_before_end"
:
True
,
"instructor_info"
:
{
# Instructor info provided
"instructors"
:
[
{
"bio"
:
"TestInstructor1 Bio."
,
"image"
:
"/fake-image-path/image1.jpeg"
,
"organization"
:
"TestX"
,
"name"
:
"TestInstructor1"
,
"title"
:
"Test Title1"
},
{
"bio"
:
"TestInstructor2 Bio."
,
"image"
:
"/fake-image-path/image2.jpeg"
,
"organization"
:
"TestX"
,
"name"
:
"TestInstructor2"
,
"title"
:
"Test Title2"
}
]
}
},
{
"display_name"
:
""
,
# Empty display name
...
...
@@ -213,6 +232,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
"static_asset_path"
:
"my/relative/path"
,
# Relative asset path
"certificates_show_before_end"
:
False
,
"catalog_visibility"
:
CATALOG_VISIBILITY_CATALOG_AND_ABOUT
,
"instructor_info"
:
{},
# Empty Instructor info
},
{
"display_name"
:
""
,
# Empty display name
...
...
@@ -223,6 +243,7 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
"static_asset_path"
:
""
,
# Empty asset path
"certificates_show_before_end"
:
False
,
"catalog_visibility"
:
CATALOG_VISIBILITY_ABOUT
,
"instructor_info"
:
None
,
},
{
# # Don't set display 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