예제 #1
0
파일: views.py 프로젝트: mluszczyk/bd-bruk
def order_estimate(order_id):
    expert_list = [(expert['id'], expert['nazwa']) for expert in model.experts()]
    estimate_order_form = forms.EstimateOrderForm.feed_with_experts(request.form, expert_list)
    if request.method == 'POST' and estimate_order_form.validate():
        try:
            model.create_estimate_order(order_id, estimate_order_form.expert.data)
        except model.DatabaseError:
            raise werkzeug.exceptions.Forbidden("Zlecenie wykonania kosztorysu już istnieje!")
        else:
            return redirect('/')

    return render_template('estimate_order.html', order_id=order_id,
                           estimate_order_form=estimate_order_form)
예제 #2
0
파일: views.py 프로젝트: mluszczyk/bd-bruk
def experts():
    experts = model.experts()
    return render_template('experts.html', experts=experts)