@register.assignment_tag
def shipping_charge_discount(method, basket):
 return method.discount(basket)

@ register . assignment_tag def shipping_charge_discount ( method , basket ) : return method . discount ( basket )
template tag for calculating the shipping discount for a given shipping method and basket .