{% for subrow in subdic.content|slice:":5" %}

{% endfor %}

 

{% if "{{subdic.content|length}}" > 5 %}

{% endif %}

如上,关键在于 循环中,里面的列表外面没有双引号

而if中,列表外面有双引号

网上很多文章太坑。。

相关文章:

  • 2022-02-10
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2021-06-11
  • 2021-12-22
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-03-14
相关资源
相似解决方案