diff options
author | Brian Waldon <bcwaldon@gmail.com> | 2013-04-25 13:37:12 -0700 |
---|---|---|
committer | Brian Waldon <bcwaldon@gmail.com> | 2013-04-26 10:13:54 -0700 |
commit | 9b030794adb80d4afa55b4bb173ed4943f479a3c (patch) | |
tree | 9fd5222e80a03147e4aff570163df160bd737381 | |
parent | 4f9d1755414a954a741269ac1d2aca7d463522c3 (diff) | |
download | warlock-9b030794adb80d4afa55b4bb173ed4943f479a3c.tar.gz |
Trigger DeprecationWarning in Model.changes
-rw-r--r-- | warlock/model.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/warlock/model.py b/warlock/model.py index aad5b37..9ce1a01 100644 --- a/warlock/model.py +++ b/warlock/model.py @@ -15,6 +15,7 @@ """Self-validating model for arbitrary objects""" import copy +import warnings import jsonpatch import jsonschema @@ -118,7 +119,9 @@ class Model(dict): @property def changes(self): - """Dumber version of 'patch' method - this should be deprecated""" + """Dumber version of 'patch' method""" + deprecation_msg = 'Model.changes will be removed in warlock v2' + warnings.warn(deprecation_msg, DeprecationWarning, stacklevel=2) return copy.deepcopy(self.__dict__['changes']) def validate(self, obj): |