Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion betterforms/multiform.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from django.utils.encoding import python_2_unicode_compatible
from django.utils.safestring import mark_safe
from django.utils.six.moves import reduce
from django.db.models.query import QuerySet


@python_2_unicode_compatible
Expand Down Expand Up @@ -180,7 +181,10 @@ def get_form_args_kwargs(self, key, args, kwargs):
try:
# If we only pass instance when there was one specified, we make it
# possible to use non-ModelForms together with ModelForms.
fkwargs['instance'] = self.instances[key]
if isinstance(self.instances[key], QuerySet):
fkwargs['queryset'] = self.instances[key]
else:
fkwargs['instance'] = self.instances[key]
except KeyError:
pass
return fargs, fkwargs
Expand Down