def salvar(): squad = Squad() squad.id= int(request.args['id']) squad.nome = request.args['nome'] squad.descricao = request.args['descricao'] squad.numeropessoas = request.args['numeropessoas'] lin = Linguagem() lin.id = request.args['id_ling'] lin.ling = request.args['ling'] squad.linguagem = lin fram = Framework() fram.id = request.args['id_fram'] fram.frame = request.args['frame'] squad.framework = fram sg = Sgbd() sg.id = request.args['id_sgbd'] sg.sistema_banco = request.args['sistema_banco'] squad.sgbd = sg print(squad.id) if squad.id == 0: squad_controller.salvar(squad) else: squad_controller.alterar(squad) return redirect('/listar')
def buscar_por_id(self, id): p = self.dao.buscar_por_id(id) p1 = Sgbd() p1.id = p[0] p1.nome = p[1] p1.versao = p[2] return p1
def listar_todos(self): lista_sgbds = [] lista_tuplas = self.dao.listar_todos() for p in lista_tuplas: p1 = Sgbd() p1.id = p[0] p1.nome = p[1] p1.versao = p[2] lista_sgbds.append(p1) return lista_sgbds
def salvarsgbd(): sgbd = Sgbd() sgbd.id = int(request.args['id']) sgbd.nome = request.args['nome'] sgbd.versao = request.args['versao'] if sgbd.id == 0: sgbd_controller.salvar(sgbd) else: sgbd_controller.alterar(sgbd) return redirect('/listarsgbds')
def buscar_por_id(self, id): p = self.dao.buscar_por_id(id) p1 = Sgbd() p1.id = p[0] p1.sistema_banco = p[1] return p1