Hi Anjo, from looking at the code in remover.py 
<https://github.com/archesproject/arches/blob/master/arches/app/utils/data_management/resources/remover.py>
 
that I linked to above, it looks like you should be importing the Resource 
model, not the ResourceInstance model. Specifically, this quick and dirty 
block of code will delete all of your resources from the Django shell:

from arches.app.models.system_settings import settings
from arches.app.models.resource import Resource 

all_resources = Resource.objects.exclude(resourceinstanceid=settings.
RESOURCE_INSTANCE_ID)
all_resources.delete()

Note that because the system settings are actually stored as a resource 
instance, you must be sure to exclude the system settings resource (using 
its ID which is stored in settings.py) when getting all of the Resource 
objects to delete.

Also note that the code above would (I think!) leave you with all of the 
elasticsearch entries for these resources, as well as any "resource to 
resource" relationships that you have created. You can see in remover.py 
that these are handled separately.

Hope that's helpful.
Adam

On Friday, April 20, 2018 at 1:47:52 PM UTC-5, Anjo Weichbrodt wrote:
>
> Hi,
>
>  I would like  to delete some resource models in the Arches designer.
> Clicking on <manage> ---> <delete>  would take away initially the resource 
> model from the list, but up on refreshing it would come back again.
> What am I missing?
>
> Thanks,
> Anjo
>
>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to