Exemplo n.º 1
0
def student():
    form = StudentForm()
    helper = UserHelper()

    if request.method == 'POST':
        if form.validate() == False:
            print(form.student_daybook.errors)
            print(form.student_name.errors)
            print(form.student_birth.errors)
            print(form.student_contract.errors)
            return render_template('student.html', form=form)
        else:
            status = helper.createStudent(form.student_daybook.data,
                                          form.student_name.data,
                                          form.student_birth.data,
                                          form.student_contract.data)

            return "Status {} ID {}".format(status)

            status = helper.updateStudent(form.student_daybook.data,
                                          form.student_name.data,
                                          form.student_birth.data,
                                          form.student_contract.data)

            return "Status {} ID {}".format(status)

            status = helper.dropStudent(form.student_daybook.data, )

            return "Status {} ID {}".format(status)

    return render_template('student.html', form=form, action='')
Exemplo n.º 2
0
def Module():
    form = ModulesForm()
    helper = UserHelper()

    if request.method == 'POST':
        if form.validate() == False:
            print(form.module_name.errors)
            print(form.teacher.errors)
            return render_template('module.html', form=form)
        else:
            status = helper.createModule(
                form.module_name.data,
                form.user_name.teacher,
            )

            return "Status {} ID {}".format(status, module_name)

            status = helper.dropModule(form.module_name.data)

            return "Status {} ID {}".format(status)
        status = helper.updateModule(
            form.module_name.data,
            form.user_name.teacher,
        )

        return "Status {} ID {}".format(status)

    return render_template('module.html', form=form, action='')
Exemplo n.º 3
0
def search_f():
    search = searchForm()
    helper = UserHelper()
    if request.method == 'POST':
        if search.validate() == False:
            print(search.m1.errors)
            print(search.m2.errors)
            return render_template('search.html', form=search)
        else:
            Tbl = helper.search(
                search.m1.data,
                search.m2.data,
            )

            return "Our search {}".format(Tbl)
    return render_template('search.html', form=search, action='')
Exemplo n.º 4
0
def user():
    form = userForm()
    helper = UserHelper()

    if request.method == 'POST':
        if form.validate() == False:
            print(form.user_phone.errors)
            print(form.user_name.errors)
            print(form.user_surname.errors)
            print(form.user_gender.errors)
            return render_template('form.html', form=form)
        else:
            user_phone, status = helper.newUser(form.user_phone.data,
                                                form.user_name.data,
                                                form.user_surname.data,
                                                form.user_gender.data)

            return "Status {} ID {}".format(status, user_phone)

    return render_template('form.html', form=form, action='')
Exemplo n.º 5
0
def learning():
    form = LearningForm()
    helper = UserHelper()

    if request.method == 'POST':
        if form.validate() == False:
            print(form.module_name_.errors)
            print(form.student_daybook_.errors)
            print(form.reporting.errors)
            print(form.point.errors)
            return render_template('learning.html', form=form)
        else:
            status = helper.createlearning(form.module_name_.data,
                                           form.student_daybook_.data,
                                           form.reporting.data,
                                           form.point.data)

            return "Status {} ID {} {}".format(status)

    return render_template('learning.html', form=form, action='')