From 595c85fafbba006320fa19daa6d5dd141e88e030 Mon Sep 17 00:00:00 2001 From: nadiel Date: Thu, 8 Jan 2015 10:36:47 +0100 Subject: [PATCH] ^^ --- src/m/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/m/service.py b/src/m/service.py index 0100901..007aa52 100644 --- a/src/m/service.py +++ b/src/m/service.py @@ -19,10 +19,11 @@ class service: def enregistrerService(self): try: connection = connectionBDD() - #obtenir id service + #obtenir id service (fonction max de sqlite ne marche pas bien...elle ne prend en compte que le premier chiffre. Ex: max(56,9)= 9... ) connection.cur.execute("SELECT count(service.idSercice) FROM service;") indiceidSer= connection.cur.execute("SELECT count(service.idService) FROM service;") idService = int(''.join(map(str,indiceidSer))) +1 + #entrée dans la base de donnée connection.cur.execute("INSERT INTO service (idService,dateService,dateDemande,rapport,idClient,idVoiturier,idService, idClient, idVoiturier) VALUES (?,?,?,?,?,?,?,?,?);",(idService, self.dateService, self.dateDemande, self.rapport) ) except Exception, e: print str(e)