@register.filter
def min_value(object_list, field):
 value_list = [getattr(o, field, None) for o in object_list]
 return min(value_list)

@ register . filter def min_value ( object_list , field ) : value_list = [ getattr ( o , field , None ) for o in object_list ] return min ( value_list )
returns the min value given an object_list and a field .