Jul*_*uis 2 django django-models
我想在我的模板中对 query_set 长度设置条件。我的查询集名为“favoris”这是我尝试过的:
{% if favoris.count>=5 %}
my html
{% endif %}
Run Code Online (Sandbox Code Playgroud)
我得到这个错误:
TemplateSyntaxError at /mysite/myview
Could not parse the remainder: '==5' from 'favoris.count==5'
Run Code Online (Sandbox Code Playgroud)
关于如何做到这一点的任何想法?感谢您的帮助
| 归档时间: |
|
| 查看次数: |
2561 次 |
| 最近记录: |