Re: Re-usable fields (Re: RFC: Proposal Dexterity API - two variants)
Robert Niederreiter <rnix-vzgNpXZZ1Rwgm7i/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <[email protected]> |
Am 2014-11-06 um 09:01 schrieb Asko Soukka: > 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. Which is actually the way it should be supposed to do it in my opinion > 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. This works, but sounds pretty fragile to me. > 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?) If it's desired to have TTW customizable behavior fields there would be the need for some kind of masquerading mechanism where an existing field written in python can be replaced by a XML defined one. For i18n and required stuff or custom widgets this would work. Anyway, as said, all this usecases sound pretty fragile and non-reliable. And i fear there is no clean technical way to get rid of this feeling. Robert > > -Asko > > ------------------------------------------------------------------------------ > _______________________________________________ > Plone-developers mailing list > Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/plone-developers ------------------------------------------------------------------------------