def extract_field_data(field):
 if (not field.form.is_bound):
  res = field.form.initial.get(field.name, field.field.initial)
  if callable(res):
   return res()
  return res
 else:
  return field.data

def extract_field_data ( field ) : if ( not field . form . is_bound ) : res = field . form . initial . get ( field . name , field . field . initial ) if callable ( res ) : return res ( ) return res else : return field . data
given a form field .