Commit 72b826fd by Richard Frank

Proxy executable methods from Database, ReplicaSetConnection

and mongo client classes
parent 6943c2a0
...@@ -26,8 +26,17 @@ def get_methods(*objs): ...@@ -26,8 +26,17 @@ def get_methods(*objs):
and hasattr(getattr(obj, attr), '__call__') and hasattr(getattr(obj, attr), '__call__')
) )
try:
# will fail to import from older versions of pymongo
from pymongo import MongoClient, MongoReplicaSetClient
except ImportError:
MongoClient, MongoReplicaSetClient = None, None
EXECUTABLE_MONGO_METHODS = get_methods(pymongo.collection.Collection, EXECUTABLE_MONGO_METHODS = get_methods(pymongo.collection.Collection,
pymongo.database.Database,
pymongo.Connection, pymongo.Connection,
pymongo.ReplicaSetConnection,
MongoClient, MongoReplicaSetClient,
pymongo) pymongo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment