Пример #1
0
 def updateData(self,req,tblName):
   #generic db update function
   try:
     res = updateDataSrvResponse()
     db_username,db_password=self.getLogin()
     con = mdb.connect('localhost', db_username, db_password, 'RappStore');
     cur = con.cursor()
     returncols=self.constructCommaColumns(req.set_cols)
     where=self.constructAndQuery(req.where_data)
     query="Update "+tblName+" SET "+returncols+where
     print query
     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])
Пример #2
0
 def tblUsersOntologyInstancesUpdateDataHandler(self, req):
     res = updateDataSrvResponse()
     res = self.updateData(req, "tblUsersOntologyInstances")
     return res
Пример #3
0
 def tblAppsRobotsUpdateDataHandler(self, req):
     res = updateDataSrvResponse()
     res = self.updateData(req, "tblAppsRobots")
     return res
Пример #4
0
 def tblRappUpdateDataHandler(self, req):
     res = updateDataSrvResponse()
     res = self.updateData(req, "tblRapp")
     return res
Пример #5
0
 def tblUsersOntologyInstancesUpdateDataHandler(self,req):
   res = updateDataSrvResponse()
   res=self.updateData(req,"tblUsersOntologyInstances")
   return res
Пример #6
0
 def tblAppsRobotsUpdateDataHandler(self,req):
   res = updateDataSrvResponse()
   res=self.updateData(req,"tblAppsRobots")
   return res
Пример #7
0
 def tblRappUpdateDataHandler(self,req):
   res = updateDataSrvResponse()
   res=self.updateData(req,"tblRapp")
   return res
Пример #8
0
 def tblCloudAgentServiceArgumentsUpdateDataHandler(self,req):
   res = updateDataSrvResponse()
   res=self.updateData(req,"cloud_agent_service_arguments")
   return res
Пример #9
0
 def tblCloudAgentUpdateDataHandler(self,req):
   res = updateDataSrvResponse()
   res=self.updateData(req,"cloud_agent")
   return res
Пример #10
0
 def tblUserUpdateDataHandler(self,req):
   res = updateDataSrvResponse()
   res=self.updateData(req,"users")
   return res