Author: Alex
Date: 2009-12-21 13:30:57 -0600 (Mon, 21 Dec 2009)
New Revision: 11931

Modified:
   django/branches/soc2009/multidb/django/forms/models.py
Log:
[soc2009/multidb] Fix to allow editing of inline formsets of objects on 
non-default databases.  Patch from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/forms/models.py
===================================================================
--- django/branches/soc2009/multidb/django/forms/models.py      2009-12-21 
19:30:49 UTC (rev 11930)
+++ django/branches/soc2009/multidb/django/forms/models.py      2009-12-21 
19:30:57 UTC (rev 11931)
@@ -681,6 +681,7 @@
                 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)
 

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to