Move models from common to cms.

Add unit tests.
This commit is contained in:
Don Mitchell
2012-12-03 12:20:15 -05:00
parent 8379e3038d
commit 50d7e6160e
7 changed files with 221 additions and 8 deletions

View File

@@ -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

View 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)