-2
A
回答
1
要計算一個字符串的話。試試這個:
{% if value|wordcount > 10 %} print this {% endif %}
0
這是truncatewords
過濾器的錯誤使用。您必須指定您希望以後截斷的單詞數:我打賭
{{ value|truncatewords:10 }}
相關問題
- 1. django templatetag?
- 2. 爲什麼使用Django TemplateTag標籤?
- 3. 動態templatetag
- 4. 如何從templatetag返回值插入到{%,如果 - 再次
- 5. 如何從templatetag返回值插入到{%如果
- 6. Django的Templatetag裝載
- 7. 獲取templatetag位置
- 8. 如何使用自定義django templatetag與Django模板if語句?
- 9. 如何在TemplateTag中獲取request.user
- 10. 如何從django templatetag訪問python列表?
- 11. 如何從templatetag動態插入數據
- 12. Django templatetag包含的用戶對象
- 13. Django templatetag用於呈現html的子集
- 14. 「動態」 網址templatetag在Django
- 15. 隨着templatetag引發錯誤
- 16. 自定義包含templatetag render_model
- 17. Django templatetag return True或False
- 18. Django templatetag「處理順序」
- 19. Django的表單字段使用自定義GETATTR templatetag
- 20. 帶有「安全」參數的url templatetag?
- 21. 在django和direct_to_template中的url templatetag
- 22. django url templatetag無法反向url
- 23. 通過TemplateTag呈現Django表格
- 24. Django的重組templatetag不正確組
- 25. PyCharm抱怨Django的`templatetag`參數
- 26. Django translate templatetag字符串參數
- 27. Django的 - 如何將多個值傳遞給templatetag
- 28. 如何通過模板在django中將值傳遞給templatetag
- 29. 如果使用KeyCharaters
- 30. 使用如果shellscripting
你想做什麼?你爲什麼要比較一個字符串與一個整數? – fourk