def normalize_form_dict(form, attr_list):
 assert isinstance(form, forms.Form)
 res = {}
 for attr in attr_list:
  res[attr] = form.cleaned_data.get(attr)
 return res

def normalize_form_dict ( form , attr_list ) : assert isinstance ( form , forms . Form ) res = { } for attr in attr_list : res [ attr ] = form . cleaned_data . get ( attr ) return res
normalize_form_dict -> a dictionary of each attr is a field name .