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