Exemple #1
0
 def visit_range(self, node: Range, parents: List[Item],
                 context: SQLQueryBuilderContext) -> Range:
     """
     Visitor for Range
     - inclusive [<Term> TO <Term>]
     - exclusive [<Term> TO <Term>]
     """
     node.low = self.visit(node.low, parents + [node], context)
     node.high = self.visit(node.high, parents + [node], context)
     return node
Exemple #2
0
    def visit_range(self, node: Range, parents: List[Item],
                    context: SQLQueryBuilderContext) -> Range:
        """
        Visitor for Range
        - inclusive [<Term> TO <Term>]
        - exclusive {<Term> TO <Term>}
        """
        if not context.field_mapper.accepts_range:
            raise UnsupportedGrammarException(
                "Range queries are not supported for this type of field")

        node.low = self.visit(node.low, parents + [node], context)
        node.high = self.visit(node.high, parents + [node], context)
        return node