mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[multi-db] Fixed scoping bug that caused pending statements to execute too soon in install.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3757 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
eb1357bf48
commit
432070d0fb
@ -408,8 +408,8 @@ def _install(app, commit=True, initial_data=True):
|
|||||||
if not model in models_installed:
|
if not model in models_installed:
|
||||||
new_pending = manager.install(initial_data=initial_data)
|
new_pending = manager.install(initial_data=initial_data)
|
||||||
created_models.append(model)
|
created_models.append(model)
|
||||||
for model, statements in new_pending.items():
|
for dep_model, statements in new_pending.items():
|
||||||
pending.setdefault(model, []).extend(statements)
|
pending.setdefault(dep_model, []).extend(statements)
|
||||||
# Execute any pending statements that were waiting for this model
|
# Execute any pending statements that were waiting for this model
|
||||||
if model in pending:
|
if model in pending:
|
||||||
for statement in pending.pop(model):
|
for statement in pending.pop(model):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user