Revisión 390
Añadido por Manu Mora Gordillo hace más de 12 años
controlies/trunk/applications/controlies/modules/LaptopsHistory.py | ||
---|---|---|
now = datetime.datetime.now()
|
||
#sql = "INSERT INTO laptops_historical (id_historical,id_laptop,datetime,username,name,id_user_type,nif,comment,id_state) "
|
||
self.DB.laptops_historical.insert (id_laptop=self.id_laptop, datetime=now.strftime('%Y-%m-%d %H:%M:%S'), username=self.username, name = self.name, id_user_type=self.id_user_type,nif=self.nif,comment=self.comment, id_state=self.id_state)
|
||
self.DB.commit()
|
||
|
||
return "OK"
|
||
|
||
... | ... | |
def modify(self):
|
||
now = datetime.datetime.now()
|
||
self.DB(self.DB.laptops_historical.id_historical==self.id_historical).update(username=self.username, name=self.name, id_user_type=self.id_user_type, nif=self.nif, comment = self.comment, id_state = self.id_state, datetime=now.strftime('%Y-%m-%d %H:%M:%S'))
|
||
|
||
self.DB.commit()
|
||
return "OK"
|
||
|
||
|
||
def delete(self):
|
||
self.DB(self.DB.laptops_history.id_historical==self.id_historical).delete()
|
||
|
||
self.DB.commit()
|
||
return "OK"
|
||
|
||
def getAllStates(self):
|
controlies/trunk/applications/controlies/modules/Laptops.py | ||
---|---|---|
|
||
def add(self):
|
||
self.DB.laptops.insert(serial_number=self.serial_number,id_trademark=self.id_trademark)
|
||
self.DB.commit()
|
||
|
||
max = self.getMaxId()
|
||
lh = LaptopsHistory(self.DB,"",max,"1","0","","","","Nuevo en el sistema")
|
||
... | ... | |
|
||
def modify(self):
|
||
self.DB(self.DB.laptops.id_laptop==self.id_laptop).update(serial_number=self.serial_number, id_trademark=self.id_trademark)
|
||
|
||
self.DB.commit()
|
||
return "OK"
|
||
|
||
|
||
def delete(self):
|
||
self.DB(self.DB.laptops.id_laptop==self.id_laptop).delete()
|
||
self.DB.commit()
|
||
return "OK"
|
||
|
||
|
Exportar a: Unified diff
Poniendo commits