Symbol | in view for Flask tutorial

与世无争的帅哥 提交于 2019-12-20 04:05:18

问题


I'm doing a tutorial for the Flask framework at http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms In this very chapter I've found a piece of code that I didn't understand. It is:

|{% for pr in providers %}
<a href="javascript:set_openid('{{pr.url}}', '{{pr.name}}');">{{pr.name}}</a> |
{% endfor %}

Why do we need the symbol | there?


回答1:


This pipe is simply adding the | between providers, as seen in the screenshot. Notice the symbol between "Google" and "Yahoo"

Pipes are used in filters, but for this specific example, that is not how they are used.



来源:https://stackoverflow.com/questions/24639437/symbol-in-view-for-flask-tutorial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!