Beispiel #1
0
def _conditional_expression(spec):
    wrapped = ConditionalExpressionSpec.wrap(spec)
    return ConditionalExpression(
        FilterFactory.from_spec(wrapped.test),
        ExpressionFactory.from_spec(wrapped.expression_if_true),
        ExpressionFactory.from_spec(wrapped.expression_if_false),
    )
Beispiel #2
0
def _conditional_expression(spec, context):
    wrapped = ConditionalExpressionSpec.wrap(spec)
    wrapped.configure(
        _make_filter(wrapped.test, context),
        ExpressionFactory.from_spec(wrapped.expression_if_true, context),
        ExpressionFactory.from_spec(wrapped.expression_if_false, context),
    )
    return wrapped
def _conditional_expression(spec, context):
    wrapped = ConditionalExpressionSpec.wrap(spec)
    wrapped.configure(
        _make_filter(wrapped.test, context),
        ExpressionFactory.from_spec(wrapped.expression_if_true, context),
        ExpressionFactory.from_spec(wrapped.expression_if_false, context),
    )
    return wrapped
Beispiel #4
0
def _conditional_expression(spec):
    # no way around this since the two factories inherently depend on each other
    from corehq.apps.userreports.filters.factory import FilterFactory
    wrapped = ConditionalExpressionSpec.wrap(spec)
    return ConditionalExpression(
        FilterFactory.from_spec(wrapped.test),
        ExpressionFactory.from_spec(wrapped.expression_if_true),
        ExpressionFactory.from_spec(wrapped.expression_if_false),
    )