We have a Dexterity behavior with lots of fields placed in its own schemata.
We need to place the title + description on top of the same schema instead within the default schemata.
There should be another way, doing it with Diazo doesn't feel right.
IIRC, there is no easy way to move fields between schematas.
But a field from your own schema can be moved to another fieldset with plone.supermodel.model.fieldset. See: https://github.com/plone/plone.app.event/blob/1.2.x/plone/app/event/dx/behaviors.py#L70
That would mean that you have to make a derivated dublin core behavior with your own title and description...
fieldset() works only for me own schemata but I can not move a different field into my schemata...well...customer needs to click on the default tab...little motivation for making this customer request happen.
You may be able to move it by manipulating the tagged values on the behavior directly.
from plone.app.dexterity.behaviors.metadata import IDublinCore
from plone.supermodel.interfaces import FIELDSETS_KEY
from plone.supermodel.model import Fieldset
custom_fieldset = Fieldset(
'mycustomset',
label=_(u'My Custom Set'),
fields=['title', 'description']
)
fieldsets = IDublinCore.getTaggedValue(FIELDSETS_KEY)
# TODO: if title and description are in a fieldset you may need to remove them there.
fieldsets.append(custom_fieldset)
# here I'am not sure if this is needed:
IDublinCore.setTaggedValue(FIELDSETS_KEY, current)
from plone.dexterity.browser import edit
from plone.z3cform.fieldsets.utils import move
class EditForm(edit.DefaultEditForm):
def updateFields(self):
""" Remove field and group from versioningbehavior """
super(EditForm, self).updateFields()
move(self, 'IVersionable.changeNote', before='IVersionable.versioning_enabled')