def get_form_data(form, prepared=False):
 if isinstance(form, FormGroup):
  data = {}
  for subform in form.forms.values():
   data.update(get_form_data(subform, prepared=prepared))
  return data
 if isinstance(form, BaseFormSet):
  data = {}
  for subform in chain([form.management_form], form.forms):
   data.update(get_form_data(subform, prepared=prepared))
  return data
 data = {}
 for (name, field) in form.fields.items():
  prefixed_name = form.add_prefix(name)
  data_value = field.widget.value_from_datadict(form.data, form.files, prefixed_name)
  if data_value:
   value = data_value
  else:
   value = form.initial.get(name, field.initial)
   if callable(value):
    value = value()
  if prepared:
   value = field.prepare_value(value)
   if (value is None):
    continue
  data[prefixed_name] = value
 return data

def get_form_data ( form , prepared = False ) : if isinstance ( form , FormGroup ) : data = { } for subform in form . forms . values ( ) : data . update ( get_form_data ( subform , prepared = prepared ) ) return data if isinstance ( form , BaseFormSet ) : data = { } for subform in chain ( [ form . management_form ] , form . forms ) : data . update ( get_form_data ( subform , prepared = prepared ) ) return data data = { } for ( name , field ) in form . fields . items ( ) : prefixed_name = form . add_prefix ( name ) data_value = field . widget . value_from_datadict ( form . data , form . files , prefixed_name ) if data_value : value = data_value else : value = form . initial . get ( name , field . initial ) if callable ( value ) : value = value ( ) if prepared : value = field . prepare_value ( value ) if ( value is None ) : continue data [ prefixed_name ] = value return data
get the current form data; with prepared .