Skip to content

Commit

Permalink
[soc2009/multidb] Fix to allow editing of inline formsets of objects …
Browse files Browse the repository at this point in the history
…on non-default databases. Patch from Russell Keith-Magee.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11931 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
alex committed Dec 21, 2009
1 parent 928e1f1 commit e3d8278
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions django/forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ def pk_is_not_editable(pk):
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)

Expand Down

0 comments on commit e3d8278

Please sign in to comment.