Beispiel #1
0
 def insertCompeticaoBD(self,rua,numero,bairro,cidade,estado,cep,nome,kata,kumite):
     string = 'Insert CompeticaoBD'
     ### Endereco ###
     self.endereco = endereco()        
     id_end = self.endereco.insert(rua,numero,bairro,cidade,estado,cep)
     print 'id_end %s' % id_end
     if id_end != -1:
         ### Competicao ###
         self.competicao = competicao()
         self.competicao.insert(id_end,nome,kata,kumite)
         self.competicao.close()
     else:
         self.endereco.delete(id_end)
         string = 'Erro no insert competicaoBD'
     self.endereco.close()
     print string
Beispiel #2
0
 def __init__(self):
     ### Endereco ###
     self.endereco = endereco()
     #self.endereco.drop()
     self.endereco.create()
     #self.endereco.insert('prata','225','ouro azul','macae','sp','24890000')
     #self.endereco.update(2,'prata','225','ouro azul','macae','sp','24890000')
     #self.endereco.delete(1)
     self.endereco.close()
     
     ### dojo ###
     self.dojo = dojo()
     self.dojo.create()
     #self.dojo.insert(1,'spartan','27600540')
     #self.dojo.update(1,'bangu','27700540')
     #self.dojo.drop()
     #self.dojo.delete(1)
     self.dojo.close()
     
     ### Pessoa ###
     self.pessoa = pessoa()
     self.pessoa.create()
     #self.pessoa.insert(2,'Filipe','98101543','88265163','1988-09-30','*****@*****.**','A+','Boa',1.80,78,'preta','p2411')
     #self.pessoa.update(1,2,'Faray','98101543','88265163','1988-09-30','*****@*****.**','A+','Boa',1.80,78,'preta','p2411')
     #self.pessoa.delete(4)
     self.pessoa.close()
     
     ### Aluno ###
     self.aluno = aluno()
     self.aluno.create()
     self.aluno.close()
     
     ### Professor ###
     self.professor = professor()
     self.professor.create()
     #self.professor.insert(2,2)
     #self.professor.update()
     #self.professor.delete(2)
     self.professor.close()
     
     ### dojo_professor ###
     self.dojo_professor = dojo_professor()
     self.dojo_professor.create()
     #self.dojo_professor.insert(2,2,1,2)
     #self.dojo_professor.update(1,'bangu','27700540')
     #self.dojo_professor.drop()
     #self.dojo_professor.delete(2,2,1,2)
     self.dojo_professor.close()
     
     ### Competicao ###
     self.competicao = competicao()
     self.competicao.create()
     #self.competicao.drop()
     #self.competicao.insert(2,'Saquarema',1,1)
     #self.competicao.update(3,2,'Macae',0,1)
     #self.competicao.delete(2)
     self.competicao.close()
     
     ### Competicao_pessoa ###
     self.competicao_pessoa = competicao_pessoa()
     self.competicao_pessoa.create()
     #self.competicao_pessoa.drop()
     #self.competicao_pessoa.insert(1,2,1,2,2,2)
     #self.competicao_pessoa.update(3,2,'Macae',0,1)
     #self.competicao_pessoa.delete(1,2,1,2)
     self.competicao_pessoa.close()
     
     ### Responsavel ###
     self.responsavel = responsavel()
     self.responsavel.create()
     #self.responsavel.insert(1,'Gustavo','98101543','*****@*****.**')
     #self.responsavel.update(1,1,'Gustavo','934101543','*****@*****.**')
     #self.responsavel.delete(2)
     #self.responsavel.drop()
     self.responsavel.close()