ANN: archetypes.schemaextender 1.0a1
optilude at gmx.net
Mon Oct 15 11:47:40 UTC 2007
A few people have expressed an interest in ContentFlavors and other ways
of extending the schema of existing Archetypes.
Florian Schulze and I have been working on such a thing called
archetypes.schemaextender. It requires a slightly different pattern to
ContentFlavors (you need to subclass fields, basically), but it's
working pretty well.
The package is in the Cheese Shop and Archetypes svn.
I would really like to get some eyes on it, and for people to try it
out. There's a TODO that outlines some of the issues we think may be
outstanding, but we need to test:
- performance: we will almost certainly need some caching, but it's
unclear whether we want a global cache or just _v_ attributes, and
how/when the cache should be invalidated
- api: we've designed it so that it strongly encourages one use case
(adding new fields) over others (modifying the schema directly, which
can be dangerous), but it may not work as naturally as we'd hoped
- pattern: the trick that makes archetypes.schemaextender work much
more cleanly than ContentFlavors, is to provide custom implementations
of getAccessor(), getMutator() and getEditAccessor() on fields. We could
provide wrappers for all the standard AT fields for use in extended
schemata (we already have a mix-in class that does the work), but we'd
need to test each field.
Take a look at the README.txt doctest to understand how to use it.
Martin + Florian
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Product-Developers