Ejemplo n.º 1
0
def get_student():
    student_id = request.cookies.get('student_id')
    if student_id:
        students = Student.select().where(Student.session_id == student_id)
        for s in students:
            return s
    return None
Ejemplo n.º 2
0
def get_student():
    student_id = request.cookies.get('student_id')
    if student_id:
        students = Student.select().where(Student.session_id == student_id)
        for s in students:
            return s
    return None
Ejemplo n.º 3
0
def random_student_id():
    while True:
        student_id = "".join([random.choice(string.ascii_letters + string.digits) for n in xrange(32)])

        students = Student.select().where(Student.session_id == student_id)
        for student in students:
            break
        else:
            return student_id
Ejemplo n.º 4
0
def random_student_id():
    while True:
        student_id = "".join([
            random.choice(string.ascii_letters + string.digits)
            for n in xrange(32)
        ])

        students = Student.select().where(Student.session_id == student_id)
        for student in students:
            break
        else:
            return student_id