From c000f6a48061839d064143be45d2453b5cf97311 Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Wed, 29 Nov 2006 19:45:22 +0000 Subject: [PATCH] [multi-db] Fixed bug in execution of pending references in install. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4137 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 3 +-- django/db/models/manager.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/django/core/management.py b/django/core/management.py index e34ff02205..5164585dbb 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -423,8 +423,7 @@ def _install(app, commit=True, initial_data=True, pending_allowed=False, 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 " diff --git a/django/db/models/manager.py b/django/db/models/manager.py index 2a109e4015..8cf1c04c7e 100644 --- a/django/db/models/manager.py +++ b/django/db/models/manager.py @@ -147,6 +147,9 @@ class Manager(object): 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)