Commit 93d81f8f by Jonathan Kamens

Don't try to wrap non-callables (so that, e.g., db.name will work)

parent a4cc0674
...@@ -53,7 +53,10 @@ class MongoProxy: ...@@ -53,7 +53,10 @@ class MongoProxy:
named "key". named "key".
""" """
return MongoProxy(getattr(self.conn, key)) attr = getattr(self.conn, key)
if hasattr(attr, '__call__'):
return MongoProxy(attr)
return attr
def __getattr__(self, key): def __getattr__(self, key):
""" If key is the name of an executable method in the MongoDB connection, """ If key is the name of an executable method in the MongoDB connection,
......
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