class TemplateLiteral
from django.template.defaulttags import TemplateLiteral
Ancestors (MRO)
- builtins.object
- django.template.smartif.TokenBase
- django.template.smartif.Literal
- django.template.defaulttags.TemplateLiteral
Attribute | Type | Defined in |
---|---|---|
__dict__ |
getset_descriptor
|
django.template.smartif.TokenBase |
__weakref__ |
getset_descriptor
|
django.template.smartif.TokenBase |
Attribute | Value | Defined in |
---|---|---|
first |
None |
django.template.smartif.TokenBase |
id |
literal |
django.template.smartif.Literal |
id |
None |
django.template.smartif.TokenBase |
lbp |
0 |
django.template.smartif.Literal |
second |
None |
django.template.smartif.TokenBase |
value |
None |
django.template.smartif.TokenBase |
def __init__(self, value, text)
django.template.defaulttags.TemplateLiteral
django.template.defaulttags.TemplateLiteral
Initialize self. See help(type(self)) for accurate signature.
def __init__(self, value, text):
self.value = value
self.text = text # for better error messages
django.template.smartif.Literal
Initialize self. See help(type(self)) for accurate signature.
def __init__(self, value):
self.value = value
def __repr__(self)
django.template.smartif.Literal
def display(self)
django.template.defaulttags.TemplateLiteral
django.template.defaulttags.TemplateLiteral
Return what to display in error messages for this node
def display(self):
return self.text
django.template.smartif.Literal
Return what to display in error messages for this node
def display(self):
return repr(self.value)
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.defaulttags.TemplateLiteral
django.template.defaulttags.TemplateLiteral
def eval(self, context):
return self.value.resolve(context, ignore_failures=True)
django.template.smartif.Literal
def eval(self, context):
return self.value
def led(self, left, parser)
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.Literal