I'm trying to execute some arbitrary code after a Dexterity content type is created. For example the content type could represent a horse.
import logging
logger = logging.getLogger("Plone")
class IHorse(form.Schema):
def __init__(self, context):
logger.info('Creating horse')
super(self).init(self, context)
I want to get the logger message "Creating horse" printed in the console when running the app in foreground. But the horse is created and I don't get messages for it. I guess that content type objects are created by the __init__
, but maybe I'm in a mistake.