A little more digging, and I found the answer.
From website :
Technically, when the template system encounters a point, it tries to perform the following searches in the following order:
Search dictionary
Search for attribute or method
Numeric Index Search
, . .
:
/ ,...
:
, , Enum , , ( : '').
, .
django.templates.base
:
if getattr(current, 'do_not_call_in_templates', False):
pass
do_not_call_in_templates, True, , .
Python Enum ( enum34 backport), . Django , :
def forDjango(cls):
cls.do_not_call_in_templates = True
return cls
Enum:
@forDjango
class DEMOS(Enum):
eggs = 'runny'
spam = 'hard'
cheese = 'smelly'
Enum, Enums .