[Tutor] Bar Operator ??
Mark Lybrand
mlybrand at gmail.com
Sun Mar 10 02:39:28 CET 2013
I am working through the Django tutorial and I have come across some syntax
I am unfamiliar with. From the context it makes perfect sense what it
does, but I haven't seen it before and was wondering if it is documented
anywhere (BTW I see other examples in the Django documentation, like date
formatting for example).
So what is this "|pluralize" syntax? Thanks in andvance
<h1>{{ poll.question }}</h1>
<ul>{% for choice in poll.choice_set.all %}
<li>{{ choice.choice_text }} -- {{ choice.votes }} vote{{
choice.votes|pluralize }}</li>{% endfor %}</ul>
<a href="{% url 'polls:detail' poll.id %}">Vote again?</a>
--
Mark :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130309/230c21e2/attachment.html>
More information about the Tutor
mailing list