def find_row(self,columns="*",condition=None,limit=1): if condition == None: condition="" sql=tinysql.select(self.table,columns,condition,"",limit) print "sql,",sql ret=self.dbh.query(sql) return ret
def find_by_id(self,id,columns="*"): sql=tinysql.select(self.table,columns,"`%s`='%s'" % (self.primary_key,id)) print "sql,",sql return self.dbh.fetchRows(sql)