Opened 10 years ago
Last modified 9 years ago
#23672 closed New feature
Add “instances” argument to BaseModelFomset.__init__() — at Initial Version
Reported by: | aki33524 | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.7 |
Severity: | Normal | Keywords: | BaseModelFormset |
Cc: | tzanke@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There are two reasons.
First, as you know, ModelForm can accept instance as keyword arguments.
I think that BaseModelFormSet should follow this. Current BaseModelFormSet support save(commit=False), which returns “instances”. But now, we cannot use it without saving in DataBase.
Second, Current BaseModelFormSet accepts “queryset” as keyword argument.
“queryset” can convert to “instances”, but “instances” cannot convert to “queryset”. I think that BaseModelFormSet should accept not “queryset” but “instances”.
For downward compatible, it would be difficult that “instances” replace with “queryset”. So I suggest adding “instances” argument to BaseModelFormSet init.