I'm trying to concatenate two numbers to pass as a parameter to an included template.
In particular, in the code below, I'm trying to pass something in for "divnum"
I looked at: How can I concatenate forloop.counter to a string in my django template
and figured that the code below would work, but it's still adding like numbers! (E.g., I'm getting "2" where I want "11")
<div id="{{ forloop.counter }}graph" style="display:none; padding: 1em, 0;margin: 1em, 0;">
{% with x=forloop.counter|stringformat:"s" %}
{% include 'graph-div.html' with divnum="1"|stringformat:"s"|add:x width="50%" question=response.question title="Nationwide" %}
{% endwith %}
</div>
How do I concatenate these numbers as strings?
There's a Warning in the docs that says: Strings that can be coerced to integers will be summed, not concatenated, as in the first example above.
so can I not do it at all? Seems like if there's a warning for it, then they know it's an issue, and there should be a solution out there somewhere...