[ckan-changes] [ckan/ckan] bde8d0: [#2158] Replace all resource extras on update so t...
GitHub
noreply at github.com
Wed Feb 18 15:08:01 UTC 2015
Branch: refs/heads/release-v2.1.4
Home: https://github.com/ckan/ckan
Commit: bde8d07d0c85bfbd6772727e76470f0bb4ddd8af
https://github.com/ckan/ckan/commit/bde8d07d0c85bfbd6772727e76470f0bb4ddd8af
Author: amercader <amercadero at gmail.com>
Date: 2015-02-18 (Wed, 18 Feb 2015)
Changed paths:
M ckan/lib/dictization/model_save.py
Log Message:
-----------
[#2158] Replace all resource extras on update so they don't get lost
Resource `extras` were being ignored on `resource_udpate`. The rest of
the resource field got updated but no the extras.
The resource `extras` field is using a custom `JsonDictType`, and
according to SQLAlchemy documentation:
> Note that the ORM by default will not detect “mutability” on such a
> type - meaning, in-place changes to values will not be detected and
> will not be flushed. Without further steps, you instead would need to
> replace the existing value with a new one on each parent object to
> detect changes.
Replacing `obj.extras` with a new dict solves the issue
http://docs.sqlalchemy.org/en/rel_0_9/core/custom_types.html#marshal-json-strings
Conflicts:
ckan/lib/dictization/model_save.py
More information about the ckan-changes
mailing list