Re-usable fields (Re: RFC: Proposal Dexterity API - two variants)

Asko Soukka <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
David Glick (Plone) wrote:
>> Behaviours are not and were never designed to be a way simply to
>> build reusable fields.
>
> Well, we need a better way to do reusable fields then.

Simple use-case: I wan't all the DC fields, expect I'd like the
Description field to be required for this particular type.

If you are developing a Python content type, you can subclass the
behavior with your own non-required Description field. If you are
developing TTW content type, you are out of luck.

Technically, for simple behaviors (only providing attribute accessible
fields, Martin's usecase 1), it would be possible to just copy the
fields form behavior schema into XML schema and make the type provide
some marker interface. We almost have i18n support schema editor, so
copied field could use translations from the original behavior. When the
fields are in XML, they'd be freely customizable.

Yet, how to implement without making it too confusing? (XML fields would
not be updated, when the behavior package is updated. Not all behaviors
could be copied into XML. How to make types have behavior schema as
marker interface without bringing its fields again?)

-Asko

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.