Exemple #1
0
    def match(self, expr):
        out=None
        if isinstance(expr, alloexpr.SelectExpr):
            out=ResultSet(self, col=expr.select, order=expr.order)
        else:
            out=ResultSet(self)

        for row in self.data:
            if expr.val(row):
                out.put(row)

        out.close()

        return out
Exemple #2
0
 def row_from_id(self, id):
     rs = ResultSet(self)
     rs.put(self.ids[id] if (id in self.ids) else [])
     return rs.close()