Commits

Al...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed ffeeaec

[soc2009/multidb] Fix to allow editing of inline formsets of objects on non-default databases. Patch from Russell Keith-Magee.

  • Participants
  • Parent commits f37e365
  • Branches soc2009/multidb

Comments (0)

Files changed (1)

File django/forms/models.py

                 qs = pk.rel.to._default_manager.get_query_set()
             else:
                 qs = self.model._default_manager.get_query_set()
+            qs = qs.using(form.instance._state.db)
             form.fields[self._pk_field.name] = ModelChoiceField(qs, initial=pk_value, required=False, widget=HiddenInput)
         super(BaseModelFormSet, self).add_fields(form, index)