[ckan-dev] Group Addition
Fawcett, David (MNIT)
David.Fawcett at state.mn.us
Tue Dec 3 16:20:28 UTC 2013
Georgios,
I put together an example of a Python script that will use the CKAN API to purge a group for you.
https://gist.github.com/fawcett/7772061
It does require that you install the third-party ckanapi Python module (https://github.com/open-data/ckanapi). You will also have to edit the script to set the correct values for your site URL, the API key of a sysadmin user, and the name of the group to be purged.
David.
-----Original Message-----
From: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of Dimitrakakis Georgios
Sent: Tuesday, December 03, 2013 3:57 AM
To: ckan-dev at lists.okfn.org
Subject: Re: [ckan-dev] Group Addition
I totally agree with you! Deleting from the database is working but it's too complex.
Can someone help me a little bit with the API and the specific command?
I mean what do I have to type and where in order to PURGE a group "test"?
Best,
G.
> If you are using a recent version of CKAN, there is the API route for
> purging groups:
> http://docs.ckan.org/en/latest/api.html#ckan.logic.action.delete.group
> _purge
>
> I hesitate to suggest direct interaction with the database (not going
> through the API), but I have done this a few times to deal with an
> issue like this. You don't want to try deleting records because of
> the complexity, but you could use an update statement to change the
> name of the 'deleted' group. This would fix the issue with the unique
> constraint on the group name.
>
>
> -----Original Message-----
> From: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of
> Dimitrakakis Georgios
> Sent: Monday, December 02, 2013 8:57 AM
> To: ckan-dev at lists.okfn.org
> Subject: [ckan-dev] Group Addition
>
> Dear all,
>
> I am trying to add a new group at a CKAN installation! The name of the
> Group did exist in the past but it was deleted!
> Therefore, I was expecting that I would be able to create it again.
> To my surprise when I try to create the group I am getting the
> following
> error: "Group name already exists in database" and in order to
> complete the creation succesfully I have to change the URL of the
> group to something different.
> Am I missing something obvious or this is the intended way ??
>
> Best,
>
> G.
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> 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
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
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