Move models from common to cms.
Add unit tests.
This commit is contained in:
@@ -17,7 +17,6 @@ class CourseDetails:
|
||||
self.syllabus = None # a pdf file asset
|
||||
self.overview = "" # html to render as the overview
|
||||
self.intro_video = None # a video pointer
|
||||
self.intro_video_loc = None # a video pointer
|
||||
self.effort = None # int hours/week
|
||||
|
||||
@classmethod
|
||||
@@ -58,7 +57,6 @@ class CourseDetails:
|
||||
temploc = temploc._replace(name='video')
|
||||
try:
|
||||
course.intro_video = get_modulestore(temploc).get_item(temploc).definition['data']
|
||||
course.intro_video_loc = temploc
|
||||
except ItemNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
22
cms/djangoapps/models/settings/course_faculty.py
Normal file
22
cms/djangoapps/models/settings/course_faculty.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from xmodule.modulestore import Location
|
||||
class CourseFaculty:
|
||||
def __init__(self, location):
|
||||
if not isinstance(location, Location):
|
||||
location = Location(location)
|
||||
# course_location is used so that updates know where to get the relevant data
|
||||
self.course_location = location
|
||||
self.first_name = ""
|
||||
self.last_name = ""
|
||||
self.photo = None
|
||||
self.bio = ""
|
||||
|
||||
|
||||
@classmethod
|
||||
def fetch(cls, course_location):
|
||||
"""
|
||||
Fetch a list of faculty for the course
|
||||
"""
|
||||
if not isinstance(course_location, Location):
|
||||
course_location = Location(course_location)
|
||||
|
||||
# Must always have at least one faculty member (possibly empty)
|
||||
Reference in New Issue
Block a user