def add_prerequisite(course_key, prereq_content_key):
 milestone = milestones_api.add_milestone({'name': _('Gating milestone for {usage_key}').format(usage_key=unicode(prereq_content_key)), 'namespace': '{usage_key}{qualifier}'.format(usage_key=prereq_content_key, qualifier=GATING_NAMESPACE_QUALIFIER), 'description': _('System defined milestone')}, propagate=False)
 milestones_api.add_course_content_milestone(course_key, prereq_content_key, 'fulfills', milestone)

def add_prerequisite ( course_key , prereq_content_key ) : milestone = milestones_api . add_milestone ( { 'name' : _ ( 'Gating milestone for {usage_key}' ) . format ( usage_key = unicode ( prereq_content_key ) ) , 'namespace' : '{usage_key}{qualifier}' . format ( usage_key = prereq_content_key , qualifier = GATING_NAMESPACE_QUALIFIER ) , 'description' : _ ( 'System defined milestone' ) } , propagate = False ) milestones_api . add_course_content_milestone ( course_key , prereq_content_key , 'fulfills' , milestone )
creates a new milestone and coursecontentmilestone indicating that the given course content fulfills a prerequisite for gating arguments: course_key : the course key prereq_content_key : the prerequisite content usage key returns: none .