def set_course_tag(user, course_id, key, value):
 (record, _) = UserCourseTag.objects.get_or_create(user=user, course_id=course_id, key=key)
 record.value = value
 record.save()

def set_course_tag ( user , course_id , key , value ) : ( record , _ ) = UserCourseTag . objects . get_or_create ( user = user , course_id = course_id , key = key ) record . value = value record . save ( )
sets the value of the users course tag for the specified key in the specified course_id .