示例#1
0
def get_student_list(coach, list_key):
    student_list = StudentList.get(list_key)
    if student_list is None:
        raise Exception("No list found with list_key='%s'." % list_key)
    if coach.key() not in student_list.coaches:
        raise Exception("Not your list!")
    return student_list
示例#2
0
def get_student_list(coach, list_key):
    student_list = StudentList.get(list_key)
    if student_list is None:
        raise Exception("No list found with list_key='%s'." % list_key)
    if coach.key() not in student_list.coaches:
        raise Exception("Not your list!")
    return student_list
示例#3
0
    def remove_student_from_coach(student, coach):
        if student.student_lists:
            actual_lists = StudentList.get(student.student_lists)
            student.student_lists = [l.key() for l in actual_lists
                                     if coach.key() not in l.coaches]

        try:
            student.remove_coach(coach.key_email)
        except ValueError:
            pass

        try:
            student.remove_coach(coach.key_email.lower())
        except ValueError:
            pass
示例#4
0
    def remove_student_from_coach(student, coach):
        if student.student_lists:
            actual_lists = StudentList.get(student.student_lists)
            student.student_lists = [
                l.key() for l in actual_lists if coach.key() not in l.coaches
            ]

        try:
            student.remove_coach(coach.key_email)
        except ValueError:
            pass

        try:
            student.remove_coach(coach.key_email.lower())
        except ValueError:
            pass