MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / _chainable_method

Method _chainable_method

mongoengine/queryset/base.py:2019–2035  ·  view source on GitHub ↗

Call a particular method on the PyMongo cursor call a particular chainable method with the provided value.

(self, method_name, val)

Source from the content-addressed store, hash-verified

2017 return code
2018
2019 def _chainable_method(self, method_name, val):
2020 """Call a particular method on the PyMongo cursor call a particular chainable method
2021 with the provided value.
2022 """
2023 queryset = self.clone()
2024
2025 # Get an existing cursor object or create a new one
2026 cursor = queryset._cursor
2027
2028 # Find the requested method on the cursor and call it with the
2029 # provided value
2030 getattr(cursor, method_name)(val)
2031
2032 # Cache the value on the queryset._{method_name}
2033 setattr(queryset, "_" + method_name, val)
2034
2035 return queryset

Callers 2

commentMethod · 0.95
max_time_msMethod · 0.95

Calls 1

cloneMethod · 0.95

Tested by

no test coverage detected