Track previous value of columns at instantiation in CQLengine

Description

In the exemple below, I except the previous_value property of the key column to stay in a default undefined value (like None) unless the instance is persisted. But this is not the case, as the previous_value property is kept in sync with the latest assignation.

This also has the side effect of marking the column as changed, even if we revert its value is reverted.

This makes me think CQLengine doesn't really keeps track of the previous, persisted, value of each column. Or maybe I misunderstood the purpose of the previous_value property.

Environment

None

Pull Requests

None

Activity

Show:
Greg Bestland
November 12, 2015, 10:02 PM

Test look good.
Not sure if really needed or not, but I added some multi field validation to the test case here
https://github.com/datastax/python-driver/pull/444

Michael Penick
November 2, 2015, 9:20 PM

+1 @ 8842b6a

Adam Holmberg
October 29, 2015, 9:25 PM
Adam Holmberg
September 8, 2015, 6:56 PM

Thanks for your understanding. You're correct – I want to invest the appropriate time analyzing the problem along with the solution offered. I haven't found the time yet, but we'll get there. I appreciate the contribution and your patience.

Former user
September 8, 2015, 6:52 PM

No problem Adam, take you time. I'd rather have a sane and thorough review of the issue than a rushed one. If this issue still bother me, I've found (ugly and unmaintainable) ways to mitigate its effect on my code for now.

And indeed, Cassandra 2.2 and 3.0 support should get the priority. Keep the good work !

Fixed

Assignee

Unassigned

Reporter

Former user

Fix versions

Labels

Reproduced in

2.5.1

Reviewer

Michael Penick