Wichert Akkerman wrote:
Previously Maurits van Rees wrote:
Hedley Roos, on 2008-08-11:
Hi all

My question applies to schemaextender and multiple named adapters for
the same type.

Both extenders just juggle the order of the fields, so they are
OrderableSchemaExtenders. Is there a way to let one "win", or be
applied last?
If Wichert says "No" I am inclined to believe him. :-)  But still:

If they were both not reordering things but just adding a field, then
the field of the extender mentioned *first* will end up *last* as I
found out for a client.  This was contrary to what I expected and
might of course be an implementation detail of schemaextender, prone
to change.

schemaextender just asks the component registry for a list of adapters.
The ordering will depend on various implementation details inside
zope.component and will probably differ depending on how your python was
compiled as well.

We *could* fix this, e.g. by adding a "weight" int property to the schema extender utility, fetch all, and sort. However, I think it's fundamentally wrong for schema extenders to depend on one another. If you really need to extend a particular extender, I would subclass it, and then register an override utility (i.e. with the same name). If you want more control, you should make a new content type.

Martin

--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to