You don't need to add is_folderish
to your types; it is an index in the catalog, and Dexterity types already have the proper attribute for that index, isPrincipiaFolderish
.
If you do need to add attributes to content types, you can either use an event subscriber or create a custom subclass of plone.dexterity.content.Item
:
subscribers can listen for the
IObjectCreatedEvent
event:from zope.app.container.interfaces import IObjectAddedEvent @grok.subscribe(IYourDexterityType, IObjectCreatedEvent) def add_foo_attribute(obj, event): obj.foo = 'baz'
custom content classes need to be registered in your type XML:
from plone.dexterity.content import Item class MyItem(Item): """A custom content class""" ...
then in your Dexterity FTI XML file, add a
klass
property:<property name="klass">my.package.myitem.MyItem</property>