def filter(self, **kwargs): sql = "SELECT * FROM %s %s " % (self.table, self._get_where(**kwargs) + self._limit) return dbhelper.query(sql)
def get(self, **kwargs): sql = "SELECT * FROM %s %s LIMIT 1" % (self.table, self._get_where(**kwargs)) result = dbhelper.query(sql) if result: return result[0] return None