renaming the value manager's initial_value field to previous_value
This commit is contained in:
@@ -12,12 +12,22 @@ class BaseValueManager(object):
|
||||
def __init__(self, instance, column, value):
|
||||
self.instance = instance
|
||||
self.column = column
|
||||
self.initial_value = copy(value)
|
||||
self.previous_value = copy(value)
|
||||
self.value = value
|
||||
|
||||
@property
|
||||
def deleted(self):
|
||||
return self.value is None and self.initial_value is not None
|
||||
return self.value is None and self.previous_value is not None
|
||||
|
||||
@property
|
||||
def changed(self):
|
||||
"""
|
||||
Indicates whether or not this value has changed.
|
||||
|
||||
:rtype: boolean
|
||||
|
||||
"""
|
||||
return self.value != self.previous_value
|
||||
|
||||
def getval(self):
|
||||
return self.value
|
||||
|
||||
@@ -62,7 +62,7 @@ class TestModelIO(BaseCassEngTestCase):
|
||||
|
||||
tm2 = TestModel.objects(id=tm.pk).first()
|
||||
assert tm2.text is None
|
||||
assert tm2._values['text'].initial_value is None
|
||||
assert tm2._values['text'].previous_value is None
|
||||
|
||||
|
||||
def test_a_sensical_error_is_raised_if_you_try_to_create_a_table_twice(self):
|
||||
|
||||
Reference in New Issue
Block a user