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
Issue: form used outside of DFT can be passed kwarg without issue, but same form throws TypeError when kwarg passed using get_form_kwargs within DFT
I am using DFT on a 2-part form for creating a bill-of-materials. For updating, I use standard UpdateViews with only the parts of the form user wants to modify. So I am able to see the forms/formsets working on their own, as well as when used by DFT.
My issue is when passing kwargs using get_form_kwargs to modify the queryset of one field:
when using my ModelForm by itself via UpdateView, I can pass form_kwargs without error and the form/querysets render as expected:
howver, when using the same form within DFT, passing the kwarg via get_form_kwargs, throws TypeError: __init__() got an unexpected keyword argument 'product' over the kwarg:
Not sure if I'm doing something incorrectly or if this is an error in DFT. I believe my use of get_form_kwargs is structured correctly, but I've only been able to locate a single example so that may be the problem.
Any feedback would be welcome
The text was updated successfully, but these errors were encountered:
Using
django-formtools
2.3,Django
3.2Issue: form used outside of DFT can be passed kwarg without issue, but same form throws TypeError when kwarg passed using
get_form_kwargs
within DFTI am using DFT on a 2-part form for creating a bill-of-materials. For updating, I use standard UpdateViews with only the parts of the form user wants to modify. So I am able to see the forms/formsets working on their own, as well as when used by DFT.
My issue is when passing kwargs using
get_form_kwargs
to modify the queryset of one field:form_kwargs
without error and the form/querysets render as expected:get_form_kwargs
, throwsTypeError: __init__() got an unexpected keyword argument 'product'
over the kwarg:Not sure if I'm doing something incorrectly or if this is an error in DFT. I believe my use of
get_form_kwargs
is structured correctly, but I've only been able to locate a single example so that may be the problem.Any feedback would be welcome
The text was updated successfully, but these errors were encountered: