

def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=':', empty_permitted=False, instance=None, collection=None):
    opts = self._meta
    if (instance is None):
        if (collection is None):
            raise TypeError('Collection must be supplied for an unbound DocumentForm')
        self.instance = opts.document(collection=collection)
        object_data = {
            
        }
    else:
        self.instance = instance
        try:
            self.instance.collection
        except AttributeError:
            raise AssertionError('Instance must be bound to a collection.')
        object_data = document_to_dict(instance, opts.fields, opts.exclude)
    if (initial is not None):
        object_data.update(initial)
    super(BaseDocumentForm, self).__init__(data, files, auto_id, prefix, object_data, data, label_suffix, empty_permitted)

dataset/ETHPy150Open peterbe/django-mongokit/django_mongokit/forms/forms.py BaseDocumentForm.__init__/VarMisuse@188/260 `error_class`->`data`