I'm going through the Django tutorial right now (https://docs.djangoproject.com/en/3.0/intro/tutorial04/) and encountering this little problem with pluralize.
With this code:
<li>{{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
{
The pluralize filter isn’t doing anything, The template returns something like this:
Just hacking again -- 2 vote{{ votes|pluralize }} // just the template code itself.
as if it was just ignoring the {{ }} indicators.
If I take pluralize out, then the choice.votes variable will display (in this case) a 2, as expected, just like it does with {{ choice.votes }}. The addition of | pluralize
seems to break the interpolation, just in that area.
I don't see any sort of import or the like that I need to add; I even copy and pasted to ensure no spelling errors, nor do I see anything in the console.log.
Any insight into what might be (not) happening here?
vote{{ choice.votes|pluralize }}