1
我有一个输出文本的模板标签。我怎样才能通过truncate_words运行这个?django - 截断模板标签的输出?
例如我的搜索结果通过以下方式返回:
{% get_translated_value result "text" %}
如何通过truncate_words:50来运行此操作?
答案是(我不能更新这个帖子几个小时):
{% filter truncatewords:30 %}
{% get_translated_value result "text" %}
{% endfilter %}
谢谢,当我回答你时,我尝试了一件事,我找到了答案。 – John 2011-05-30 18:29:43