How to output a comma delimited list in jinja python template?

前端 未结 3 867
半阙折子戏
半阙折子戏 2020-12-22 16:56

If I have a list of users say [\"Sam\", \"Bob\", \"Joe\"], I want to do something where I can output in my jinja template file:

{%          


        
3条回答
  •  借酒劲吻你
    2020-12-22 17:20

    you could also use the builtin "join" filter (http://jinja.pocoo.org/docs/templates/#join like this:

    {{ users|join(', ') }}
    

提交回复
热议问题