Commits

Anonymous committed b3c88ec

[multi-db] Fixed bug in execution of pending references in install.

  • Participants
  • Parent commits e6a5447
  • Branches multiple-db-support

Comments (0)

Files changed (2)

File django/core/management.py

                 manager = model._default_manager
                 if model in models_installed:
                     for rel_class, f in pending[model]:
-                        for statement in manager.get_pending(rel_class, f):
-                            statement.execute()
+                        manager.get_pending(rel_class, f).execute()
                     pending.pop(model)
                 elif not pending_allowed:
                     raise Exception("%s is not installed, but it has pending "

File django/db/models/manager.py

         return pending
 
     def get_pending(self, rel_class, f):
+        """Get list pending statement relating my model to rel_class via
+        field f
+        """
         builder = self.db.get_creation_module().builder
         return builder.get_ref_sql(self.model, rel_class, f)