wil*_*low 14 python django templates boolean
我想做的事情如下:
{% if ("view_video" in video_perms) OR purchase_override %}
Run Code Online (Sandbox Code Playgroud)
那可能吗?
Spa*_*man 29
给你:
{% if user in users %}
If users is a QuerySet, this will appear if user is an
instance that belongs to the QuerySet.
{% endif %}
Run Code Online (Sandbox Code Playgroud)
和
{% if a == b or c == d and e %}
Run Code Online (Sandbox Code Playgroud)
请注意,and
优先级高于or
,并且括号不可能.如果需要,使用嵌套块.
归档时间: |
|
查看次数: |
21272 次 |
最近记录: |