summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2006-11-29 19:45:22 +0000
committerJason Pellerin <jpellerin@gmail.com>2006-11-29 19:45:22 +0000
commitc000f6a48061839d064143be45d2453b5cf97311 (patch)
tree604ea0629263f3d5a0806b374acad7e4d1532678
parente4e6bf0712fdd774e73bea7aadf799656544b513 (diff)
[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
-rw-r--r--django/core/management.py3
-rw-r--r--django/db/models/manager.py3
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)