updating value manager to use deepcopy instead of copy
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
CHANGELOG
|
||||
|
||||
0.8.4
|
||||
* changing value manager previous value copying to deepcopy
|
||||
|
||||
0.8.3
|
||||
* better logging for operational errors
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.8.3
|
||||
0.8.4
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#column field types
|
||||
from copy import copy
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
from datetime import date
|
||||
import re
|
||||
@@ -8,12 +8,13 @@ from cql.query import cql_quote
|
||||
|
||||
from cqlengine.exceptions import ValidationError
|
||||
|
||||
|
||||
class BaseValueManager(object):
|
||||
|
||||
def __init__(self, instance, column, value):
|
||||
self.instance = instance
|
||||
self.column = column
|
||||
self.previous_value = copy(value)
|
||||
self.previous_value = deepcopy(value)
|
||||
self.value = value
|
||||
|
||||
@property
|
||||
@@ -31,7 +32,7 @@ class BaseValueManager(object):
|
||||
return self.value != self.previous_value
|
||||
|
||||
def reset_previous_value(self):
|
||||
self.previous_value = copy(self.value)
|
||||
self.previous_value = deepcopy(self.value)
|
||||
|
||||
def getval(self):
|
||||
return self.value
|
||||
@@ -52,6 +53,7 @@ class BaseValueManager(object):
|
||||
else:
|
||||
return property(_get, _set)
|
||||
|
||||
|
||||
class ValueQuoter(object):
|
||||
"""
|
||||
contains a single value, which will quote itself for CQL insertion statements
|
||||
|
||||
@@ -145,8 +145,6 @@ class TestSetColumn(BaseCassEngTestCase):
|
||||
column = columns.Set(columns.Text(min_length=100))
|
||||
assert isinstance(column.value_col, columns.Text)
|
||||
|
||||
|
||||
|
||||
def test_to_python(self):
|
||||
""" Tests that to_python of value column is called """
|
||||
column = columns.Set(JsonTestColumn)
|
||||
|
||||
Reference in New Issue
Block a user