Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I order behavior IDublinCore in Dexterity Type?

I'm writing a product using Python Dexterity Type, and I have Title and Description, this fields come from a behavior plone.app.dexterity.behaviors.metadata.IDublinCore, but I neeed reorder this fields with my fields.

Example:

My fields: document, collage, age, biography

IDublinCore: Title, Description

The order: collage, Title, document, age, biography, Description

How I Do it?

like image 664
Juliano Araújo Avatar asked Oct 17 '16 17:10

Juliano Araújo


1 Answers

Since you got your own Dexterity Type you can handle with form directives aka setting taggedValues on the interface.

from plone.autoform import directives


class IYourSchema(model.Schema):

    directives.order_before(collage='IDublinCore.title')
    collage = schema.TextLine(
        title=u'Collage',
    )

You find excellent documentation about this feature in the plone documentation http://docs.plone.org/external/plone.app.dexterity/docs/reference/form-schema-hints.html#appearance-related-directives

like image 153
Mathias Avatar answered Oct 05 '22 23:10

Mathias