[ckan-dev] add organizations programmatically
Stefan Oderbolz
stefan.oderbolz at liip.ch
Fri Dec 11 16:12:13 UTC 2015
If you want to use organization_create directly, you can find an example
how to create organizations programmatically here:
https://github.com/ogdch/ckanext-swisstopo/blob/bbd5ed6034b2252170da7f1ba41eccf57542beb0/ckanext/swisstopo/harvesters/swisstopoharvester.py#L440-L457
Depending on your needs and the context of this requirement, it might be
worth looking into the ckanapi package, which makes these kinds of things
easier: https://github.com/ckan/ckanapi
- Stefan
On Fri, Dec 11, 2015 at 4:46 PM, Hildegard Gerlach <
hildegard.gerlach at jrc.ec.europa.eu> wrote:
> Dear all,
>
> I would like to add organizations programmatically reading the input from
> a JSON file.
> I have already an extension in which I read the JSON files but I am not
> sure how to proceed to create the organizations (with extra fields) and
> checking if they exist already.
> Is there something similar already around ? Or can someone tell me how I
> have to send the parameters ?
> I am using CKAN 2.2
> I tried to put some log.debug statements in the file
> ckan/ckan/logic/action/create.py and created an organization from the
> interface, but I couldn't find the log messages, i.e. the program was not
> used ?
>
> I have also seen
> http://docs.ckan.org/en/ckan-2.2/api.html#ckan.logic.action.create.organization_create
> but I am not sure how to use it.
>
> Thanks
>
> Hilde
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
--
Liip AG // Limmatstrasse 183 // CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20151211/e35dd142/attachment-0003.html>
More information about the ckan-dev
mailing list