diff --git a/professor/__init__.py b/professor/__init__.py index 736e540..72663bc 100644 --- a/professor/__init__.py +++ b/professor/__init__.py @@ -41,7 +41,7 @@ class SessionFlask(SessionMixin, Flask): pass import pymongo dbname = app.config.get('MONGODB_CONFIG', {}).pop('db', 'professor') -conn = pymongo.Connection(**app.config.get('MONGODB_CONFIG', {})) +conn = pymongo.MongoClient(**app.config.get('MONGODB_CONFIG', {})) db = conn[dbname] app.session_store = MongoSessionStore(db.session) diff --git a/professor/skeleton.py b/professor/skeleton.py index e114c0c..7931706 100644 --- a/professor/skeleton.py +++ b/professor/skeleton.py @@ -26,6 +26,7 @@ __all__ = ('skeleton', 'sanitize') from bson.binary import Binary +from bson.int64 import Int64 from bson.code import Code from bson.dbref import DBRef from bson.errors import InvalidDocument @@ -36,6 +37,7 @@ BSON_TYPES = set([ int, + Int64, long, str, unicode, diff --git a/professor/util.py b/professor/util.py index c0bed2d..5472a7c 100644 --- a/professor/util.py +++ b/professor/util.py @@ -138,11 +138,9 @@ def connect_to(database): else: host = database['hostname'] port = 27017 - conn = pymongo.Connection( + conn = pymongo.MongoClient( host=host, - port=port, - network_timeout=2, - slaveok=True, + port=port ) conndb = conn[database['dbname']]