Merge pull request #242 from chrisbrantley/chrisbrantley-patch-1

Wrap call to key() in list() so it can be indexed
This commit is contained in:
Diederik van der Boor
2016-10-04 10:31:51 +02:00
committed by GitHub
+1 -1
View File
@@ -180,7 +180,7 @@ class BasePolymorphicModelFormSet(BaseModelFormSet):
# Extra forms, cycle between all types # Extra forms, cycle between all types
# TODO: take the 'extra' value of each child formset into account. # TODO: take the 'extra' value of each child formset into account.
total_known = len(self.queryset_data) total_known = len(self.queryset_data)
child_models = self.child_forms.keys() child_models = list(self.child_forms.keys())
model = child_models[(i - total_known) % len(child_models)] model = child_models[(i - total_known) % len(child_models)]
form_class = self.get_form_class(model) form_class = self.get_form_class(model)