def make_field_formatter(attr, filters=None):
 filter_ = None
 if filters:
  filter_ = filters.get(attr)
 def get_field(obj):
  field = getattr(obj, attr, '')
  if (field and filter_):
   field = filter_(field)
  return field
 name = _format_field_name(attr)
 formatter = get_field
 return (name, formatter)

def make_field_formatter ( attr , filters = None ) : filter_ = None if filters : filter_ = filters . get ( attr ) def get_field ( obj ) : field = getattr ( obj , attr , '' ) if ( field and filter_ ) : field = filter_ ( field ) return field name = _format_field_name ( attr ) formatter = get_field return ( name , formatter )
given an object attribute .