@register.filter
def remaining(item_list, total):
 list_length = len(item_list)
 expected_total = int(total)
 if (list_length != expected_total):
  return range(0, (expected_total - list_length))
 return ''

@ register . filter def remaining ( item_list , total ) : list_length = len ( item_list ) expected_total = int ( total ) if ( list_length != expected_total ) : return range ( 0 , ( expected_total - list_length ) ) return ''
calculate the remaining time for a start date and a timedelta .