callable(*object*)[](http://docs.jinkan.org/docs/jinja2/templates.html#callable "Permalink to this definition")
Return whether the object is callable (i.e., some kind of function). Note that classes are callable, as are instances with a __call__() method.
defined(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#defined "Permalink to this definition")
Return true if the variable is defined:
~~~
{% if variable is defined %}
value of variable: {{ variable }}
{% else %}
variable is not defined
{% endif %}
~~~
See the [default()](http://docs.jinkan.org/docs/jinja2/templates.html#default "default") filter for a simple way to set undefined variables.
divisibleby(*value*, *num*)[](http://docs.jinkan.org/docs/jinja2/templates.html#divisibleby "Permalink to this definition")
Check if a variable is divisible by a number.
escaped(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#escaped "Permalink to this definition")
Check if the value is escaped.
even(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#even "Permalink to this definition")
Return true if the variable is even.
iterable(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#iterable "Permalink to this definition")
Check if it’s possible to iterate over an object.
lower(*value*)
Return true if the variable is lowercased.
mapping(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#mapping "Permalink to this definition")
Return true if the object is a mapping (dict etc.).
New in version 2.6.
none(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#none "Permalink to this definition")
Return true if the variable is none.
number(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#number "Permalink to this definition")
Return true if the variable is a number.
odd(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#odd "Permalink to this definition")
Return true if the variable is odd.
sameas(*value*, *other*)[](http://docs.jinkan.org/docs/jinja2/templates.html#sameas "Permalink to this definition")
Check if an object points to the same memory address than another object:
~~~
{% if foo.attribute is sameas false %}
the foo attribute really is the `False` singleton
{% endif %}
~~~
sequence(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#sequence "Permalink to this definition")
Return true if the variable is a sequence. Sequences are variables that are iterable.
string(*value*)
Return true if the object is a string.
undefined(*value*)[](http://docs.jinkan.org/docs/jinja2/templates.html#undefined "Permalink to this definition")
Like [defined()](http://docs.jinkan.org/docs/jinja2/templates.html#defined "defined") but the other way round.
upper(*value*)
Return true if the variable is uppercased.
- 介绍
- 预备知识
- 安装
- 基本 API 使用
- 实验性的 Python 3 支持
- API
- 基础
- Unicode
- 高层 API
- 自动转义
- 标识符的说明
- 未定义类型
- 上下文
- 加载器
- 字节码缓存
- 实用工具
- 异常
- 自定义过滤器
- 求值上下文
- 自定义测试
- 全局命名空间
- 低层 API
- 元 API
- 沙箱
- API
- 运算符拦截
- 模板设计者文档
- 概要
- 变量
- 过滤器
- 测试
- 注释
- 空白控制
- 转义
- 行语句
- 模板继承
- HTML 转义
- 控制结构清单
- 导入上下文行为
- 表达式
- 内置过滤器清单
- 内置测试清单
- 全局函数清单
- 扩展
- 自动转义扩展
- 扩展
- 添加扩展
- i18n 扩展
- 表达式语句
- 循环控制
- With 语句
- 自动转义扩展
- 编写扩展
- 集成
- Babel 集成
- Pylons
- TextMate
- Vim
- 从其它的模板引擎切换
- Jinja1
- Django
- Mako
- 提示和技巧
- Null-Master 退回
- 交替的行
- 高亮活动菜单项
- 访问父级循环