Merge pull request #208 from rebeckag/mongodb_fix
pymongo 3.0 no longer contains the deprecated Connection class
This commit is contained in:
2
setup.py
2
setup.py
@@ -37,7 +37,7 @@ install_requires = [
|
|||||||
tests_require = [
|
tests_require = [
|
||||||
'mongodict',
|
'mongodict',
|
||||||
'pyasn1',
|
'pyasn1',
|
||||||
'pymongo',
|
'pymongo==3.0.1',
|
||||||
'python-memcached == 1.51',
|
'python-memcached == 1.51',
|
||||||
'pytest',
|
'pytest',
|
||||||
'mako',
|
'mako',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import logging
|
import logging
|
||||||
|
from pymongo.mongo_client import MongoClient
|
||||||
|
|
||||||
__author__ = 'rolandh'
|
__author__ = 'rolandh'
|
||||||
|
|
||||||
from pymongo import Connection
|
|
||||||
#import cjson
|
#import cjson
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -18,9 +18,9 @@ logger = logging.getLogger(__name__)
|
|||||||
class Cache(object):
|
class Cache(object):
|
||||||
def __init__(self, server=None, debug=0, db=None):
|
def __init__(self, server=None, debug=0, db=None):
|
||||||
if server:
|
if server:
|
||||||
connection = Connection(server)
|
connection = MongoClient(server)
|
||||||
else:
|
else:
|
||||||
connection = Connection()
|
connection = MongoClient()
|
||||||
|
|
||||||
if db:
|
if db:
|
||||||
self._db = connection[db]
|
self._db = connection[db]
|
||||||
|
|||||||
Reference in New Issue
Block a user