Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
François Decq committed Jul 27, 2017
1 parent 28d598b commit 5c125cb
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 5c125cb

Please sign in to comment.