How to use the jinja.nodes.BinaryExpression function in Jinja

To help you get started, we’ve selected a few Jinja examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pallets / jinja / jinja / nodes.py View on Github external
"""


class FloorDivExpression(BinaryExpression):
    """
    {{ foo // bar }}
    """


class AddExpression(BinaryExpression):
    """
    {{ foo + bar }}
    """


class SubExpression(BinaryExpression):
    """
    {{ foo - bar }}
    """


class ModExpression(BinaryExpression):
    """
    {{ foo % bar }}
    """


class PowExpression(BinaryExpression):
    """
    {{ foo ** bar }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
return [self.expr] + list(chain(*self.ops))

    def __repr__(self):
        return 'CompareExpression(%r, %r)' % (
            self.expr,
            self.ops
        )


class MulExpression(BinaryExpression):
    """
    {{ foo * bar }}
    """


class DivExpression(BinaryExpression):
    """
    {{ foo / bar }}
    """


class FloorDivExpression(BinaryExpression):
    """
    {{ foo // bar }}
    """


class AddExpression(BinaryExpression):
    """
    {{ foo + bar }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
def __init__(self, expr, ops, lineno=None, filename=None):
        Expression.__init__(self, lineno, filename)
        self.expr = expr
        self.ops = ops

    def get_items(self):
        return [self.expr] + list(chain(*self.ops))

    def __repr__(self):
        return 'CompareExpression(%r, %r)' % (
            self.expr,
            self.ops
        )


class MulExpression(BinaryExpression):
    """
    {{ foo * bar }}
    """


class DivExpression(BinaryExpression):
    """
    {{ foo / bar }}
    """


class FloorDivExpression(BinaryExpression):
    """
    {{ foo // bar }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
)


class MulExpression(BinaryExpression):
    """
    {{ foo * bar }}
    """


class DivExpression(BinaryExpression):
    """
    {{ foo / bar }}
    """


class FloorDivExpression(BinaryExpression):
    """
    {{ foo // bar }}
    """


class AddExpression(BinaryExpression):
    """
    {{ foo + bar }}
    """


class SubExpression(BinaryExpression):
    """
    {{ foo - bar }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
"""


class DivExpression(BinaryExpression):
    """
    {{ foo / bar }}
    """


class FloorDivExpression(BinaryExpression):
    """
    {{ foo // bar }}
    """


class AddExpression(BinaryExpression):
    """
    {{ foo + bar }}
    """


class SubExpression(BinaryExpression):
    """
    {{ foo - bar }}
    """


class ModExpression(BinaryExpression):
    """
    {{ foo % bar }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
"""


class SubExpression(BinaryExpression):
    """
    {{ foo - bar }}
    """


class ModExpression(BinaryExpression):
    """
    {{ foo % bar }}
    """


class PowExpression(BinaryExpression):
    """
    {{ foo ** bar }}
    """


class AndExpression(BinaryExpression):
    """
    {{ foo and bar }}
    """


class OrExpression(BinaryExpression):
    """
    {{ foo or bar }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
"""


class ModExpression(BinaryExpression):
    """
    {{ foo % bar }}
    """


class PowExpression(BinaryExpression):
    """
    {{ foo ** bar }}
    """


class AndExpression(BinaryExpression):
    """
    {{ foo and bar }}
    """


class OrExpression(BinaryExpression):
    """
    {{ foo or bar }}
    """


class NotExpression(UnaryExpression):
    """
    {{ not foo }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
"""


class PowExpression(BinaryExpression):
    """
    {{ foo ** bar }}
    """


class AndExpression(BinaryExpression):
    """
    {{ foo and bar }}
    """


class OrExpression(BinaryExpression):
    """
    {{ foo or bar }}
    """


class NotExpression(UnaryExpression):
    """
    {{ not foo }}
    """


class NegExpression(UnaryExpression):
    """
    {{ -foo }}
    """
github pallets / jinja / jinja / nodes.py View on Github external
"""


class AddExpression(BinaryExpression):
    """
    {{ foo + bar }}
    """


class SubExpression(BinaryExpression):
    """
    {{ foo - bar }}
    """


class ModExpression(BinaryExpression):
    """
    {{ foo % bar }}
    """


class PowExpression(BinaryExpression):
    """
    {{ foo ** bar }}
    """


class AndExpression(BinaryExpression):
    """
    {{ foo and bar }}
    """