[ckan-dev] Create Package programmatically

Toby Dacre toby.okfn at gmail.com
Fri Mar 8 14:21:41 UTC 2013


On 8 March 2013 13:52, Nigel Babu <nigel.babu at okfn.org> wrote:
> Hi Ryan,
>
> `ckan.logic.action.package_create` is probably the right way to do it.

Just as a comment on this for clarity logic actions/auth functions
must never be called directly.  They mast go via get_action() etc
using the api or paster post will do this but for extensions and
within ckan these must never be called directly

thanks
Toby

> Can
> you explain more about there not being an HTTP call associated with your
> code? You could use the action API via the paster post command, but you'd
> need to be on the server for that.  Or from Python via the plugins
> toolkit[1] (again, you have to be on the server).
>
> [1] http://docs.ckan.org/en/latest/toolkit.html
>
> Nigel
>
>
> On 7 March 2013 04:21, Ryan Clark <ryan.clark at azgs.az.gov> wrote:
>>
>> I'm trying to generate Packages from ISO 19139 documents. What is the best
>> way to create a new package programmatically? I was thinking that
>> ckan.logic.action.package_create looked like it might be the best place, but
>> I'd rather not have to spoof the context object, since there won't be an
>> HTTP request associated with the code I'm writing.
>>
>> Thanks!!
>> ____________________
>>
>> Ryan Clark
>> ryan.clark at azgs.az.gov
>> (520) 302-4871
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
> _______________________________________________
> 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