def deleteData(self,req,tblName): #generic db delete function try: res = deleteDataSrvResponse() db_username,db_password=self.getLogin() con = mdb.connect('localhost', db_username, db_password, 'RappStore'); cur = con.cursor() where=self.constructAndQuery(req.where_data) query="Delete from "+tblName+where cur.execute("LOCK TABLES "+tblName+" WRITE") cur.execute(query) cur.execute("UNLOCK TABLES") res.success.data=True res.trace.append("Success") except mdb.Error, e: res.trace.append(("Database Error %d: %s" % (e.args[0],e.args[1]))) res.success.data=False print "Error %d: %s" % (e.args[0],e.args[1])
def tblAppsRobotsDeleteDataHandler(self, req): res = deleteDataSrvResponse() res = self.deleteData(req, "tblAppsRobots") return res
def tblRappDeleteDataHandler(self, req): res = deleteDataSrvResponse() res = self.deleteData(req, "tblRapp") return res
def tblAppsRobotsDeleteDataHandler(self,req): res = deleteDataSrvResponse() res=self.deleteData(req,"tblAppsRobots") return res
def tblRappDeleteDataHandler(self,req): res = deleteDataSrvResponse() res=self.deleteData(req,"tblRapp") return res
def tblCloudAgentServiceArgumentsDeleteDataHandler(self,req): res = deleteDataSrvResponse() res=self.deleteData(req,"cloud_agent_service_arguments") return res
def tblCloudAgentDeleteDataHandler(self,req): res = deleteDataSrvResponse() res=self.deleteData(req,"cloud_agent") return res
def tblUserDeleteDataHandler(self,req): res = deleteDataSrvResponse() res=self.deleteData(req,"users") return res