示例#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 get_list(coach, request_handler):
    list_id = request_handler.request_string('list_id')
    student_list = StudentList.get(list_id)
    if student_list is None:
        raise Exception("No list found with list_id='%s'." % list_id)
    if coach.key() not in student_list.coaches:
        raise Exception("Not your list!")
    return student_list
示例#4
0
def get_list(coach, request_handler):
    list_id = request_handler.request_string("list_id")
    student_list = StudentList.get(list_id)
    if student_list is None:
        raise Exception("No list found with list_id='%s'." % list_id)
    if coach.key() not in student_list.coaches:
        raise Exception("Not your list!")
    return student_list
示例#5
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.coaches.remove(coach.key_email)
        except ValueError:
            pass

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

        student.put()
示例#6
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.coaches.remove(coach.key_email)
        except ValueError:
            pass

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

        student.put()