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:
@@ -5,22 +5,18 @@ import warnings
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import pymongo
|
||||
import pickle
|
||||
import weakref
|
||||
|
||||
from fixtures import Base, Mixin, PickleEmbedded, PickleTest
|
||||
|
||||
from mongoengine import *
|
||||
from mongoengine.base import _document_registry, NotRegistered, InvalidDocumentError
|
||||
from mongoengine.connection import _get_db
|
||||
from mongoengine.base import NotRegistered, InvalidDocumentError
|
||||
from mongoengine.connection import get_db
|
||||
|
||||
|
||||
class DocumentTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
connect(db='mongoenginetest')
|
||||
self.db = _get_db()
|
||||
self.db = get_db()
|
||||
|
||||
class Person(Document):
|
||||
name = StringField()
|
||||
|
||||
Reference in New Issue
Block a user