Django

Code

Changeset 3762

Show
Ignore:
Timestamp:
09/14/06 21:24:38 (2 years ago)
Author:
jpellerin
Message:

[multi-db] Fixed orphan pending error message. Changed get_create_table to only fill pending if backend supports constraints.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/multiple-db-support/django/core/management.py

    r3761 r3762  
    412412 
    413413            for model in pending.keys(): 
     414                manager = model._default_manager 
    414415                if model in models_installed: 
    415416                    for rel_class, f in pending[model]: 
    416                         manager = model._default_manager  
    417417                        for statement in manager.get_pending(rel_class, f): 
    418418                            statement.execute() 
    419419                    pending.pop(model) 
    420420                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) 
    424423    except Exception, e: 
    425424        import traceback 
  • django/branches/multiple-db-support/django/db/backends/ansi/sql.py

    r3760 r3762  
    104104                        # We haven't yet created the table to which this field 
    105105                        # 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)) 
    107108                table_output.append(' '.join(field_output)) 
    108109        if opts.order_with_respect_to: 
     
    125126 
    126127        # Pull out any pending statements for me 
    127         if (pending and 
    128             backend.supports_constraints): 
     128        if pending: 
    129129            if model in pending: 
    130130                for rel_class, f in pending[model]: