[Sqlalchemy-tickets] Issue #3410: JSONB field doesn't track changes (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Andrey S. <iss...@bi...> - 2015-05-01 10:39:59
|
New issue 3410: JSONB field doesn't track changes https://bitbucket.org/zzzeek/sqlalchemy/issue/3410/jsonb-field-doesnt-track-changes Andrey Semenov: I have a code like this: ``` #!python stats = Column(JSONB, nullable=False, default={}) ``` then having model object with: ``` #!ipython In [17]: o.stats Out[17]: {} In [18]: id(o.stats) Out[18]: 4377529152 ``` I then modify `stats` column ``` #!ipython In [20]: o.account_log(log) In [21]: o.stats Out[21]: {'traffic': {'attempt_ts_spawn': 1430474948, 'confirm_operator_id': 185, 'confirm_ts_spawn': 1430474948}} In [22]: id(o.stats) Out[22]: 4375370840 ``` at the end of `account_log` the stats is re-assigned with `copy.deepcopy`, but when doing `Session.flush()` I see no requests done to the server. As I understand sqlalchemy doesn't think there's any change to model made to flush it to server. How could I ensure the changes are flushed to the SQL server? |