django模板的简单开关标记。
django-switch-templatetag的Python项目详细描述
django模板的简单“switch”语句。
安装
- Install to PYTHONPATH, etc.
然后要么:
Add ^{tt1}$ to ^{tt2}$ and then use:
{% load switch_templatetag %}… in your templates.
或:
- Add ^{tt3}$ to your ^{tt4}$ entry in ^{tt5}$ (Django 1.9)
或:
Add to builtins (< Django 1.9) with in some ^{tt6}$:
from django.template.base import add_to_builtins add_to_builtins('switch_templatetag.templatetags.switch'