formset.is_bound returns False for ModelFormsets created with queryset as argument
|Reported by:||Jannis||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When a Modelformset is instantiated via a queryset, its is_bound attribute returns False although all of its forms are linked to instances of the queryset. This seems a bit odd to me because formset and forms are bound as soon as the Modelformset is instantiated via data (i.e. request.POST).
>>> from django.forms.models import modelformset_factory >>> from models import Testobject >>> TestFormset = modelformset_factory(Testobject) >>> formset = TestFormset(queryset=Testobject.objects.all()) >>> formset.is_bound False >>> formset.forms.is_bound False >>> formset.forms.instance Testobject object