def insert_access(self, nno, listno, tablename, dbname): self.logindd(nno) exit_model = access_model(dbname) resultln = self.tudisearch(listno) wheres = [] if resultln: for rsl in resultln: d = {} d['dizhi'] = rsl['dizhi'] wheres.append(d) exit_model.inserttusql(resultln, tablename, wheres)
def accessup(self,s,tablename,dbn): mm=access_model(dbn) l1=[] l2=[] lis=self.lie[1:len(self.lie)] #数据表的名字除去第一列的列名 for ss in s: #每一行的数据 dd={} id1={} for i,l in enumerate(lis): dd[l]=ss[i+1] #列名和数据组成字典 数据从第二列开始 id1[self.lie[0]]=str(ss[0]) #第一列的表名和数据组成字典用来查询 l1.append(dd) l2.append(id1) #print(l1) queueLock.acquire() mm.update(l1,l2,tablename)#l1是更新数据,l2是where中的内容,table表名 self.lie=[] queueLock.release()
def accessup(self,s,tablename,dbn): mm=access_model(dbn) l1=[] l2=[] lis=self.lie[1:len(self.lie)] for ss in s: dd={} id1={} for i,l in enumerate(lis): dd[l]=ss[i+1] id1[self.lie[0]]=str(ss[0]) l1.append(dd) l2.append(id1) #print(l1) queueLock.acquire() mm.update(l1,l2,tablename) self.lie=[] queueLock.release()
def searchac(databserul,tablen,where): search=access_model(databserul) reasult=search.muselect(where,tablen) return reasult
def accessselectm(s,tablename,dbn): mm=access_model(dbn) res=mm.muselect(s,tablename) return res