Django

Code

Changeset 3430

Show
Ignore:
Timestamp:
07/22/06 23:05:30 (2 years ago)
Author:
jpellerin
Message:

[multi-db] Backed out settings access through conf.settings, which was based on an incorrect understanding of settings implementation.

Files:

Legend:

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

    r3428 r3430  
    1 from django import conf 
     1from django.conf import settings, UserSettingsHolder 
    22from django.core import signals 
    33from django.core.exceptions import ImproperlyConfigured 
     
    2020 
    2121 
    22 if not conf.settings.DATABASE_ENGINE: 
    23     conf.settings.DATABASE_ENGINE = 'dummy' 
     22if not settings.DATABASE_ENGINE: 
     23    settings.DATABASE_ENGINE = 'dummy' 
    2424 
    2525 
     
    5050    def __init__(self, settings=None): 
    5151        if settings is None: 
    52             settings = conf.settings 
     52            from django.conf import settings 
    5353        self.settings = settings 
    5454        self.backend = self.load_backend() 
     
    145145        connection is returned.         
    146146        """ 
    147         settings = conf.settings 
    148147        try: 
    149148            cnx = self.local.connections 
     
    154153            cnx[name].close() 
    155154        if name is _default: 
    156             cnx[name] = connect(conf.settings) 
     155            cnx[name] = connect(settings) 
    157156            return cnx[name] 
    158157        try: 
     
    168167        # pass global settings so that the default connection settings 
    169168        # can be defaults for the named connections. 
    170         database = conf.UserSettingsHolder(settings) 
     169        database = UserSettingsHolder(settings) 
    171170        for k, v in info.items(): 
    172171            setattr(database, k, v) 
     
    182181    current settings. 
    183182    """ 
    184     settings = conf.settings 
    185183    app = klass._meta.app_label 
    186184    model = klass.__name__