Commit 54bffc17 by Richard Frank

Allow for proxying of collections accessed by attribute,

not just by __getitem__.
parent aca622e3
......@@ -83,8 +83,11 @@ class MongoProxy:
"""
attr = getattr(self.conn, key)
if hasattr(attr, '__call__') and key in EXECUTABLE_MONGO_METHODS:
return Executable(attr, self.logger)
if hasattr(attr, '__call__'):
if key in EXECUTABLE_MONGO_METHODS:
return Executable(attr, self.logger)
else:
return MongoProxy(attr)
return attr
def __call__(self, *args, **kwargs):
......
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