Exemple #1
0
 def count(self):
     ret = Query.count(self)
     self._sql = ret['sql']
     data = self.getConnect().get(ret['sql'] , *ret['param'])
     if data :
         return data.row_count
     return 0
Exemple #2
0
 def add(self , attr):
     ret = Query.add(self , attr)
     self._sql = ret['sql']
     #print ret['param']
     return self.getConnect().execute(ret['sql'] , *ret['param'])
Exemple #3
0
 def __init__(self, table):
     Query.__init__(self, table)
     # 元数据绑定
     self.Meta = False
Exemple #4
0
 def delete(self):
     ret = Query.delete(self)
     self._sql = ret['sql']
     return self.getConnect().execute(ret['sql'] , *ret['param'])