问题
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