I'm developing a small back-end add-on (for Plone 6) and I'd like to programmatically create a certain Folder structure when my add-on is installed.
I'm not sure how I should configure the add-on / where I should write my code.
Can anyone give me some suggestion and/or point me to documentation?
[more details]
I've used cookieplone
to setup the add-on
and then tried plonecli add
both site_initialization
and upgrade_step
but they "don't feel like" the correct approach (or maybe they are and I'm just missing something )
The operation that I need to perform is something like the following:
portal = plone.api.portal.get() # ?
if "my_folder" not in portal:
subfolder = create(
container=portal,
type="Folder",
id="my_folder",
title="...",
)
subfolder.setDescription("...")