MCPcopy Create free account
hub / github.com/mongodb/motor / create_attribute

Method create_attribute

motor/metaprogramming.py:252–266  ·  view source on GitHub ↗
(self, cls, attr_name)

Source from the content-addressed store, hash-verified

250
251class MotorCursorChainingMethod(MotorAttributeFactory):
252 def create_attribute(self, cls, attr_name):
253 cursor_method = getattr(cls.__delegate_class__, attr_name)
254
255 @functools.wraps(cursor_method)
256 def return_clone(self, *args, **kwargs):
257 cursor_method(self.delegate, *args, **kwargs)
258 return self
259
260 # This is for the benefit of Synchro, and motor_extensions.py
261 return_clone.is_motorcursor_chaining_method = True
262 return_clone.pymongo_method_name = attr_name
263 if self.doc:
264 return_clone.__doc__ = self.doc
265
266 return return_clone
267
268
269T = TypeVar("T")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected