summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2013-04-25 13:37:12 -0700
committerBrian Waldon <bcwaldon@gmail.com>2013-04-26 10:13:54 -0700
commit9b030794adb80d4afa55b4bb173ed4943f479a3c (patch)
tree9fd5222e80a03147e4aff570163df160bd737381
parent4f9d1755414a954a741269ac1d2aca7d463522c3 (diff)
downloadwarlock-9b030794adb80d4afa55b4bb173ed4943f479a3c.tar.gz
Trigger DeprecationWarning in Model.changes
-rw-r--r--warlock/model.py5
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):