阅读背景:

使用django模板标签拆分列表

来源:互联网 

I have a single list my_list in my context, and I'd like to render it as two "columns", with the first (n+1)/2 items in the first column and the last n/2 items in the second column. Is there a straight-forward way to do this with django template tags/filters or do I need to pre-split the list into two in my view? in my context, and




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: