[Django]Django的Template filter: truncateword:"n"不起作用

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django]Django的Template filter: truncateword:"n"不起作用

Danfeng Lu
Hi all:

{{ user.username|truncatewords:"5" }}
这样的代码,但是其中的truncatewords完全不起作用,别的filter都没问题,比如length/upper等...
请问有谁知道是怎么回事么?

--
Warmest regards!

邮箱Email: [hidden email]
MSN: [hidden email]
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese
Reply | Threaded
Open this post in threaded view
|

Re: [Django]Django的Template filter: truncateword:"n"不起作用

Xupeng Yun

2008/1/23 Danfeng Lu <[hidden email]>:
Hi all:

{{ user.username|truncatewords:"5" }}
这样的代码,但是其中的truncatewords完全不起作用,别的filter都没问题,比如length/upper等...
请问有谁知道是怎么回事么?


这个filter的截取单位是word,你的意思是要截取5个字母,当然不工作了。

--
I like Python & Linux.
Blog: http://recordus.cublog.cn
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese
Reply | Threaded
Open this post in threaded view
|

Re: [Django]Django的Template filter: truncateword:"n"不起作用

Danfeng Lu
Thanx...明白了...^.^

在08-1-26,Xupeng Yun <[hidden email]> 写道:

2008/1/23 Danfeng Lu <[hidden email]>:
Hi all:

{{ user.username|truncatewords:"5" }}
这样的代码,但是其中的truncatewords完全不起作用,别的filter都没问题,比如length/upper等...
请问有谁知道是怎么回事么?


这个filter的截取单位是word,你的意思是要截取5个字母,当然不工作了。

--
I like Python & Linux.
Blog: <a href="http://recordus.cublog.cn" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://recordus.cublog.cn

_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://python.cn/mailman/listinfo/python-chinese" target="_blank">http://python.cn/mailman/listinfo/python-chinese



--
Warmest regards!

邮箱Email: [hidden email]
MSN: [hidden email]
_______________________________________________
python-chinese
Post: send [hidden email]
Subscribe: send subscribe to [hidden email]
Unsubscribe: send unsubscribe to  [hidden email]
Detail Info: http://python.cn/mailman/listinfo/python-chinese