Beispiel #1
0
def agenda() -> 'html':
    agencies = Agencies.select()
    users = User.select()
    return render_template('agenda/pa00.html',
                           the_users=users,
                           the_agencies=agencies,
                           titulo="Agenda de Ramais")
Beispiel #2
0
def viewagencies():
    agencies = Agencies.select()
    titles = ('Nº', 'Nome', 'Cidade', 'Endereço', 'Telefone',
              'Editar / Excluir ')
    return render_template('viewagencies.html',
                           the_agencies=agencies,
                           the_row_titles=titles,
                           the_title='Agências')
Beispiel #3
0
def register_pa():
    agencies = Agencies.create(
        pa_num=request.form['pa_num'],
        pa_name=request.form['pa_name'],
        pa_city=request.form['pa_city'],
        pa_address=request.form['pa_address'],
        pa_phone=request.form['pa_phone'],
    )
    print(agencies)
    return redirect('viewagencies')
Beispiel #4
0
def pa03() -> 'html':
    agencies = Agencies.select()
    users = User.select()
    return render_template('agenda/pa03.html',
                           the_users=users,
                           the_agencies=agencies)
Beispiel #5
0
def del_agencies(id):
    query = Agencies.get(Agencies.id == id)
    query.delete_instance()
    return render_template('viewagencies.html',
                           the_success='Agência excluída com sucesso!')
Beispiel #6
0
def user():
    data_agencies = Agencies.select()
    return render_template('user.html',
                           the_title='Cadastro de usuários',
                           the_agencies=data_agencies)