Is there a way to convert a number to a string in django's template? Or do I need to make a custom template tag. Something like:
{{ 1|stringify }} # '1'
You can use stringformat to convert a variable to a string:
{{ value|stringformat:"i" }}
See documentation for formatting options (the leading % should not be included).
{{ value|stringformat:"i" }} is exactly the same as the output of {{ value }}.{% with var="this is an integer: "|add:an_int_variable %} without |stringformat:"i" on the an_int_variable first.You can use {{ value|slugify }} (https://docs.djangoproject.com/en/1.10/ref/templates/builtins/).
{% if item.type == content_type %}one would produce a true result the other would not.{% if item.type == content_type|add:0 %}to accomplish some kind of type casting.