[ckan-dev] How to access an array in extra-fields ?

William Waites ww at styx.org
Thu Apr 28 15:14:52 UTC 2011


* [2011-04-28 16:03:41 +0100] David Raznick <kindly at gmail.com> écrit:

] I am doing a rewrite of that code as we speak.  I am not too sure how to fix
] it though.  The wui expects a string and in the api it treats it as json.
] So saving in the form is bound to destroy up the json.

Judging from the output it is getting saved as a repr'd version of the
python - should it not alt least be using json.dumps?

For reading from the API, you *could* try to json.loads it and if that
fails put the string. But mind that this is a backwards incompatible
change - there is code out there (mine and others') that expects the
value to be a string.

-w

-- 
William Waites                <mailto:ww at styx.org>
http://river.styx.org/ww/        <sip:ww at styx.org>
F4B3 39BF E775 CF42 0BAB  3DF0 BE40 A6DF B06F FD45




More information about the ckan-dev mailing list