Added multidb support
No change required to upgrade to multiple databases. Aliases are used to describe the database and these can be manually registered or fall through to a default alias using connect. Made get_connection and get_db first class members of the connection class. Old style _get_connection and _get_db still supported. Refs: #84 #87 #93 #215
This commit is contained in:
parent
63c5a4dd65
commit
e80144e9f2
15 changed files with 180 additions and 103 deletions
|
|
@ -7,7 +7,7 @@ from mongoengine.queryset import (QuerySet, QuerySetManager,
|
|||
MultipleObjectsReturned, DoesNotExist,
|
||||
QueryFieldList)
|
||||
from mongoengine import *
|
||||
from mongoengine.connection import _get_connection
|
||||
from mongoengine.connection import get_connection
|
||||
from mongoengine.tests import query_counter
|
||||
|
||||
|
||||
|
|
@ -2276,7 +2276,7 @@ class QuerySetTest(unittest.TestCase):
|
|||
|
||||
# check that polygon works for users who have a server >= 1.9
|
||||
server_version = tuple(
|
||||
_get_connection().server_info()['version'].split('.')
|
||||
get_connection().server_info()['version'].split('.')
|
||||
)
|
||||
required_version = tuple("1.9.0".split("."))
|
||||
if server_version >= required_version:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue