From a50d895f289cee37b5ae53f1bee33fbdea5a0fa3 Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Thu, 29 Jun 2006 22:00:25 +0000 Subject: [multi-db] Updated tests/runtests.py to create test databases for all named connections (if any) in addition to the default connection. Updated LazyConnectionManager to allow assignment to connection names. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3238 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'django') diff --git a/django/db/__init__.py b/django/db/__init__.py index d37e8b34c7..ed0b8a4fb9 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -96,9 +96,12 @@ class LazyConnectionManager(object): def __getitem__(self, k): try: - return self._connections[k] + return self.__dict__['_connections'][k] except KeyError: return self.connect(k) + + def __setitem__(self, k, v): + self.__dict__['_connections'][k] = v def connect(self, name): """Return the connection with this name in -- cgit v1.3