'Deserialize to a CourseKey instance'

def to_python(self, course_key):

    course_key = super(CourseKeyField, self).to_python(course_key)
    assert isinstance(course_key, (NoneType, basestring, CourseKey))
    if (course_key == ''):
        return None
    if isinstance(course_key, basestring):
        return SlashSeparatedCourseKey.from_deprecated_string(course_key)
    else:
        return course_key
