Add multiply filter

This commit is contained in:
PCoder 2017-11-22 00:16:39 +01:00
parent 567ff8d314
commit 16e5fb8f5c

View file

@ -31,3 +31,14 @@ def get_value_from_dict(dict_data, key):
return dict_data.get(key) return dict_data.get(key)
else: else:
return "" return ""
@register.filter('multiply')
def multiply(value, arg):
"""
usage: {{ quantity|multiply:price }}
:param value:
:param arg:
:return:
"""
return value*arg