[ckan-dev] Group Addition

Dimitrakakis Georgios giorgis at ucnet.uoc.gr
Tue Dec 3 20:17:58 UTC 2013


Many thanks to you also Anibal!

G.

> This also can help[0], it prints out the SQL needed to purge a group.
>
> [0] https://github.com/anibalpacheco/ckanext-agesic/blob/master/delete_group
>
> On 12/03/2013 05:35 PM, Dimitrakakis Georgios wrote:
>> Thanks a lot for that!
>>
>> I see that I have to upgrade to 2.2 from 2.1.1b before using the script,
>> but unfortunately "git fetch" doesn't find any "release-v2.2"....
>>
>> Any ideas on that?
>>
>> Again thx a million for the script!
>>
>> Warmest regards,
>>
>> G.
>>
>>> 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
>>>
>>>
>>> _______________________________________________
>>> 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
>
>
> _______________________________________________
> 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.




More information about the ckan-dev mailing list