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

Function mark_key_as_changed_wrapper

mongoengine/base/datastructures.py:29–38  ·  view source on GitHub ↗

Decorator that ensures _mark_as_changed method gets called with the key argument

(parent_method)

Source from the content-addressed store, hash-verified

27
28
29def mark_key_as_changed_wrapper(parent_method):
30 """Decorator that ensures _mark_as_changed method gets called with the key argument"""
31
32 def wrapper(self, key, *args, **kwargs):
33 # Can't use super() in the decorator.
34 if not args or key not in self or self[key] != args[0]:
35 self._mark_as_changed(key)
36 return parent_method(self, key, *args, **kwargs)
37
38 return wrapper
39
40
41class BaseDict(dict):

Callers 1

BaseDictClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected