I am looping through cart-items, and want to multiply quantity with unit-price like this:
{% for cart_item in cart.cartitem_set.all %}
{{cart_item.quantity}}
You can do it in template with filters.
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#writing-custom-template-filters
From documentation:
Here’s an example filter definition:
def cut(value, arg):
"""Removes all values of arg from the given string"""
return value.replace(arg, '')
And here’s an example of how that filter would be used:
{{ somevariable|cut:"0" }}