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

Steve McMahon <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAOqzbggoHEVPb46FvQom=U2n6BH5+OHtKWYXqQejPQCiMmzm1g@mail.gmail.com>
On Thu, Nov 6, 2014 at 12:01 AM, Asko Soukka <[email protected]> wrote:

> ...
> 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.


Things are not quite that bad yet. The class factory support on many of the
DC metadata fields is very shallow. In most cases it only creates
properties on the behavior class that get from and set to the matching
attributes of the context.

So, if you want an required description field (the default is not
required), you can turn off the basic meta data behavior and create your
own title and description fields. Use the right field IDs and nothing will
break in Plone. This depends on nothing in Plone testing for the provision
of the IBasic interface or trying to adapt the objects with IBasic.

For better or worse, I've taught this fact to many students over the past
few years and shown them how they're not stuck with the the title and help
text from most of the DC metadata fields. (Some of those fields require
validators or vocabularies, so it's not always trivial to replace them.)

If we're going to break this, Plone 5 would be the place to do it. If we
break it, though, we'd better find a way to offer comparable
customizability.

------------------------------------------------------------------------------

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
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.