from flask import Flask, render_template, request, redirect import sys sys.path.append('/marciano/TrabalhosdePython/TrabalhoSquad') from controller.squad_controller import SquadController from controller.framework_controller import FrameworkController from controller.linguagem_controller import LinguagemController from controller.sgbd_controller import SgbdController from model.squad import Squad from model.framework import Framework from model.linguagem import Linguagem from model.sgbd import Sgbd app = Flask(__name__) squad_controller = SquadController() nome = 'Cadastros Squad' @app.route('/') def inicio(): return render_template('index.html', titulo_app = nome ) @app.route('/listar') def listar(): squads = squad_controller.listar_todos() return render_template('listar.html', titulo_app = nome, lista = squads) @app.route('/cadastrar') def cadastrar(): squad = Squad() squad.framework = Framework()
import sys sys.path.append("C:/Users/900143/Desktop/Certo") from controller.squad_controller import BackController, FrontController,SGBDController , SquadController, BackEnd, FrontEnd, SGBD, Squad from flask import Flask, render_template, request, redirect sqc = SquadController() squad = sqc.select_byId(3) print(squad)
import sys sys.path.append('C:/Users/900143/Desktop/Squad') from controller.sgbd_controller import SGBD, SGBD_controller from controller.squad_controller import Squad, SquadController s = Squad(0, 'aaaa', 'aaa', 3) s.sgbd = 1 s.linguagemBack = 1 s.linguagemFront = 1 print(s) sc = SquadController() sc.insert(s)
from controller.sgbd_controller import SgbdController from controller.framework_controller import FrameworkController from controller.backend_controller import BackendController from controller.squad_controller import SquadController ok = SgbdController() okok = FrameworkController() okokok = BackendController() okokokok = SquadController() print(okok.listar_todos()) # ok print(ok.listar_todos()) # ok print(okokok.listar_todos()) # ok print(okokokok.listar_todos()) # error(command SELECT denied) ?????
from model.squad import Squad while True: print(''' ************************** 1 - Listar todos 2 - Buscar por id 3 - Salvar (not working) 4 - Alterar 5 - Deletar 6 - SAIR ************************** ''') choice = int(input('>> ')) squad = SquadController() if choice == 1: # listar todos for i in squad.listar_todos(): print(i) if choice == 2: id = int(input('Digite o ID\n>>')) teste = str(squad.buscar_por_id(id)) print(teste) if choice == 3: squad_ = Squad() squad_.NOME = input('Digite o nome do squad: ') squad_.DESCRICAO = input('DIgite uma descricao para o squad: ') squad_.NUMEROPESOSAS = int(input('Digite o numero de pessoas: '))
import sys sys.path.append('Aulas/Aula38') from controller.squad_controller import SquadController from controller.backend_controller import BackEndController from controller.frontend_controller import FrontEndController from controller.sgbd_controller import SgbdController from model.squad import Squad sc = SquadController() bc = BackEndController() fc = FrontEndController() sgc = SgbdController() # ----------- Salvar um novo Squad no banco # p = Squad() # p.nome = 'Teste-5' # p.descricao = 'Test5' # p.numpessoas = 15 # p.backend.append(1) # p.backend.append(2) # p.frontend.append(1) # p.sgbd.append(1) # sc.salvar(p) # ----------- Lista todos squads # for i in sc.listar_todos(): # print(i) # ----------- Alterar squad especifico
def listar(): squad_controller = SquadController() squads = squad_controller.listar_todos() return render_template('listar.html', titulo_app = nome, lista = squads)
import sys sys.path.append('Aulas/Aula37') from controller.squad_controller import SquadController sc = SquadController() for p in sc.listar_todos(): print(p)