示例#1
0
from flask import Flask, render_template, request
import sys
sys.path.append(
    'C:/Users/900159/Documents/GitHub/TrabalhosPython/Aula36 17-01')
sys.path.append(
    'C:/Users/Usuario/Documents/GitHub/TrabalhosPython/Aula36 17-01')
from Controller.squads_controller import SquadsController
from Model.squads import Squads

app = Flask(__name__)
pessoa = Squads()
controller = SquadsController()
name = 'Sistema de consulta Times de Desenvolvimento'


@app.route('/')
def inicio():
    return render_template('index.html', titulo_app=name)


@app.route('/listar')
def listar():
    return render_template('listar_menu.html', titulo_app=name)


@app.route('/listar/todos')
def listar_todos():
    squads = controller.listar_todos()
    return render_template('listar_todos.html', titulo_app=name, lista=squads)

示例#2
0
sys.path.append('C:/Users/900145/Documents/TrabalhosEquipe/Sistema_SQUADS')

from Controller.squads_controller import SquadsController
from Model.squads import Squads

def menu():
    print('*********************************')
    print('* 1- Listar por codigo de Squad * #Comando funcionando')
    print('* 2- Cadastrar Squad Dev        * #Comando funcionando')
    print('* 3- Cadastrar Linguagem        * #Comando funcionando ')
    print('* 4- Alterar Squad Dev          * #Comando funcionando GLORIAAAAAAAAAAAA ')
    print('* 5- Deletar Squad Dev          * # ')
    print('*********************************')
    return int(input('* Digite a opcao: '))

controller = SquadsController()
squad = Squads()

op = menu()
if op == 1:
    print('-----Busca por codigo-----')
    id = int(input('Digite o codigo: '))
    print(controller.listar_por_id(id))

    print('-----Listar todos-----')
    print(controller.listar_todos())

elif op == 2:
    print('-----Cadastrar SQUADS_DEV-----')
    
    squad.name_squad = 'Homens de BRANCO'
示例#3
0
import sys
sys.path.append('C:/Users/900159/Documents/GitHub/TrabalhosPython/Aula36 17-01')
sys.path.append('C:/Users/Usuario/Documents/GitHub/TrabalhosPython/Aula36 17-01')
from Controller.squads_controller import SquadsController
from Model.squads import Squads

def menu():
    print('*********************************')
    print('* 1- Listar por codigo de Squad *')
    print('* 2- Cadastrar Squad Dev        *')
    print('* 3- Alterar Squad Dev          *')
    print('* 4- Deletar Squad Dev          *')
    print('*********************************')
    return int(input('* Digite a opcao: '))

controller = SquadsController()
squad = Squads()

op = menu()
if op == 1:
    print('-----Busca por codigo-----')
    id = int(input('Digite o codigo: '))
    print(controller.listar_por_id(id))

elif op == 2:
    print('-----Cadastrar SQUADS_DEV-----')
    
    squad.name_squad = 'Homens de preto'
    squad.descricao = 'Smith'
    squad.numero_pessoas = 5
    squad.linguagembackend = 'Cobol'