[ckan-dev] Storing JSON in resource metadata
Hendrik Bunke
bunke.hendrik at gmail.com
Tue Jun 16 15:09:30 UTC 2015
--On 2015-06-16 15:17, Hendrik Bunke wrote:
> --On 2015-06-16 14:34, Hendrik Bunke wrote:
> > This code, essentially, works for datasets but not for resources. That's why I
> > was assuming that storing JSON in resources extra fields is not supported yet.
>
> Correction: that code works only for updating an existing
> dataset, not for creating one. I'll debug that, sorry for the
> noise.
Tried to debug but couldn't find the reason. Has anybody an idea,
why _updating_ an existing dataset with the above mentioned
validator (which stores JSON) works as expected, but _creation_
of a new dataset (or resource) throws an error like this (from
the debugger):
> /home/bunke/dev/edawax/ckanenv/src/ckan/ckan/logic/action/create.py(310)resource_create()
-> errors = e.error_dict['resources'][-1]
(Pdb) e.error_dict
{'__junk': [u"The input field [('dara_authors', 1,
u'authorID_Type'), ('dara_authors', 1, u'firstname'),
('dara_authors', 1, u'affil'), ('dara_authors', 1, u'lastname'),
('dara_authors', 0, u'firstname'), ('dara_authors', 0,
u'authorID_Type'), ('dara_authors', 1, u'authorID'),
('dara_authors', 0, u'authorID'), ('dara_authors', 0,
u'lastname'), ('dara_authors', 0, u'affil')] was not expected."]}
thanks
hendrik
More information about the ckan-dev
mailing list