Changeset 3762
- Timestamp:
- 09/14/06 21:24:38 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/multiple-db-support/django/core/management.py
r3761 r3762 412 412 413 413 for model in pending.keys(): 414 manager = model._default_manager 414 415 if model in models_installed: 415 416 for rel_class, f in pending[model]: 416 manager = model._default_manager417 417 for statement in manager.get_pending(rel_class, f): 418 418 statement.execute() 419 419 pending.pop(model) 420 420 else: 421 raise Exception("%s is not installed, but there are " 422 "pending statements that need it: %s" 423 % (model, statements)) 421 raise Exception("%s is not installed, but it has pending " 422 "references" % model) 424 423 except Exception, e: 425 424 import traceback django/branches/multiple-db-support/django/db/backends/ansi/sql.py
r3760 r3762 104 104 # We haven't yet created the table to which this field 105 105 # is related, so save it for later. 106 pending.setdefault(f.rel.to, []).append((model, f)) 106 if backend.supports_constraints: 107 pending.setdefault(f.rel.to, []).append((model, f)) 107 108 table_output.append(' '.join(field_output)) 108 109 if opts.order_with_respect_to: … … 125 126 126 127 # Pull out any pending statements for me 127 if (pending and 128 backend.supports_constraints): 128 if pending: 129 129 if model in pending: 130 130 for rel_class, f in pending[model]:
