def add_prerequisite_course(course_key, prerequisite_course_key):
 if (not is_prerequisite_courses_enabled()):
  return None
 milestone_name = _('Course {course_id} requires {prerequisite_course_id}').format(course_id=unicode(course_key), prerequisite_course_id=unicode(prerequisite_course_key))
 milestone = milestones_api.add_milestone({'name': milestone_name, 'namespace': unicode(prerequisite_course_key), 'description': _('System defined milestone')})
 milestones_api.add_course_milestone(course_key, 'requires', milestone)
 milestones_api.add_course_milestone(prerequisite_course_key, 'fulfills', milestone)

def add_prerequisite_course ( course_key , prerequisite_course_key ) : if ( not is_prerequisite_courses_enabled ( ) ) : return None milestone_name = _ ( 'Course {course_id} requires {prerequisite_course_id}' ) . format ( course_id = unicode ( course_key ) , prerequisite_course_id = unicode ( prerequisite_course_key ) ) milestone = milestones_api . add_milestone ( { 'name' : milestone_name , 'namespace' : unicode ( prerequisite_course_key ) , 'description' : _ ( 'System defined milestone' ) } ) milestones_api . add_course_milestone ( course_key , 'requires' , milestone ) milestones_api . add_course_milestone ( prerequisite_course_key , 'fulfills' , milestone )
it would create a milestone .