class Operator

from django.template.smartif import Operator


  

Ancestors (MRO)

  1. builtins.object
  2. django.template.smartif.TokenBase
  3. django.template.smartif.Operator
AttributeTypeDefined in
AttributeValueDefined in
def __repr__(self)
django.template.smartif.TokenBase
Return repr(self).
    def __repr__(self):
        out = [str(x) for x in [self.id, self.first, self.second] if x is not None]
        return "(" + " ".join(out) + ")"
def display(self)
django.template.smartif.TokenBase
Return what to display in error messages for this node
    def display(self):
        """
        Return what to display in error messages for this node
        """
        return self.id
def eval(self, context)
django.template.smartif.Operator
        def eval(self, context):
            try:
                return func(context, self.first, self.second)
            except Exception:
                # Templates shouldn't throw exceptions when rendering.  We are
                # most likely to get exceptions for things like {% if foo in bar
                # %} where 'bar' does not support 'in', so default to False
                return False
def led(self, left, parser)
django.template.smartif.Operator
django.template.smartif.Operator
        def led(self, left, parser):
            self.first = left
            self.second = parser.expression(bp)
            return self
django.template.smartif.TokenBase
    def led(self, left, parser):
        # Left denotation - called in infix context
        raise parser.error_class(
            "Not expecting '%s' as infix operator in if tag." % self.id
        )
def nud(self, parser)
django.template.smartif.TokenBase
    def nud(self, parser):
        # Null denotation - called in prefix context
        raise parser.error_class(
            "Not expecting '%s' in this position in if tag." % self.id
        )