[ckan-dev] package_update throws error when adding extra field

Kirstein, Fabian fabian.kirstein at fokus.fraunhofer.de
Mon Feb 4 09:23:49 UTC 2013


I'm using 2.0a currently. I've mocked my controller and put it on GitHub: https://github.com/FabiApfelkern/ckanext-custcon

Thank you very much!




-----Ursprüngliche Nachricht-----
Von: ckan-dev-bounces at lists.okfn.org [mailto:ckan-dev-bounces at lists.okfn.org] Im Auftrag von Sean Hammond
Gesendet: Freitag, 1. Februar 2013 15:02
An: ckan-dev at lists.okfn.org
Betreff: Re: [ckan-dev] package_update throws error when adding extra field

> I'm developing a custom controller, which is using the CKAN Action-API 
> to manipulate datasets.  First I fetch the dataset with
> 
> dataset = get_action('package_show')(context, {'id': id})
> 
> then I add something to the extras field:
> 
> dataset['extras'].append({'value': 'test', 'key': 'new'})
> 
> Finally I try to save it with:
> 
> result  =  get_action('package_update')(context, dataset)
> 
> Unfortunately I receive an error: IndexError: list index out of range 
> It seems that the unflatten method has a problem with my new extra 
> field.

That's interesting. What version of CKAN are you using? And can you send us your CKAN extension, or a mock extension that demonstrates the error (e.g. post it to github)? That would make it easier for me to reproduce the problem and investigate.

_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org
http://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev




More information about the ckan-dev mailing list