def _init_data(self, data, obj, files):
data = self.prepare(data)<EOL>for name, subform in self._forms.items():<EOL><INDENT>obj_value = get_obj_value(obj, name)<EOL>if inspect.isclass(subform):<EOL><INDENT>fclass = subform<EOL><DEDENT>else:<EOL><INDENT>fclass = subform.__class__<EOL><DEDENT>subform_prefix = '<STR_LIT>'.format(<EOL>prefix=self._prefix,<EOL>name=name.lower()<EOL>)<EOL>subform = fclass(<EOL>data,<EOL>obj_value,<EOL>files=files,<EOL>locale=self._locale,<EOL>tz=self._tz,<EOL>prefix=subform_prefix,<EOL>backref=getattr(subform, '<STR_LIT>', None)<EOL>)<EOL>self._forms[name] = subform<EOL>setattr(self, name, subform)<EOL>self._input_data = self._input_data or subform._input_data<EOL><DEDENT>for name, formset in self._sets.items():<EOL><INDENT>sclass = formset.__class__<EOL>objs = formset._objs or get_obj_value(obj, name)<EOL>formset_name = '<STR_LIT>'.format(<EOL>prefix=self._prefix,<EOL>name=name.lower()<EOL>)<EOL>formset = sclass(<EOL>form_class=formset._form_class,<EOL>name=formset_name,<EOL>data=data,<EOL>objs=objs,<EOL>files=files,<EOL>locale=self._locale,<EOL>tz=self._tz,<EOL>create_new=formset._create_new,<EOL>backref=formset._backref<EOL>)<EOL>self._sets[name] = formset<EOL>setattr(self, name, formset)<EOL>for _form in formset._forms:<EOL><INDENT>self._input_data = self._input_data or _form._input_data<EOL><DEDENT><DEDENT>for name, field in self._fields.items():<EOL><INDENT>subdata = data.getlist(self._prefix + name)<EOL>subfiles = files.getlist(self._prefix + name)<EOL>self._input_data = self._input_data or subdata or subfiles<EOL>obj_value = get_obj_value(obj, name)<EOL>was_deleted = self._prefix + name + '<STR_LIT>' in data<EOL>if was_deleted:<EOL><INDENT>subdata = obj_value = subfiles = None<EOL><DEDENT>field.load_data(subdata, obj_value, file_data=subfiles,<EOL>locale=self._locale, tz=self._tz)<EOL>if was_deleted:<EOL><INDENT>field._deleted = True<EOL><DEDENT><DEDENT>
Load the data into the form.