You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using MultiForm for editing models (= putting 'instance' in the kwargs), if one or several of the forms contained inside the MultiForm are FormSet, a TypeError with message "init() got an unexpected keyword argument 'instance'" is raised.
I think this error is due to the "fkwargs = kwargs.copy()" line in the "get_form_args_kwargs" method of multiform.py. If the MultiForm kwargs are copied for any of the child, they will all contain the 'instance' argument, instead of the 'queryset' needed for FormSet.
The text was updated successfully, but these errors were encountered:
I have added a possible fix for this bug. See lines 184-187 in get_form_args_kwargs of MultiModelForm. For that to work I needed to add "from django.db.models.query import QuerySet" (see line 18 in the imports) multiform_master.txt
decolens
pushed a commit
to decolens/django-betterforms
that referenced
this issue
Jul 27, 2017
When using MultiForm for editing models (= putting 'instance' in the kwargs), if one or several of the forms contained inside the MultiForm are FormSet, a TypeError with message "init() got an unexpected keyword argument 'instance'" is raised.
I think this error is due to the "fkwargs = kwargs.copy()" line in the "get_form_args_kwargs" method of multiform.py. If the MultiForm kwargs are copied for any of the child, they will all contain the 'instance' argument, instead of the 'queryset' needed for FormSet.
The text was updated successfully, but these errors were encountered: