1 Nov 2009 04:30
Re: proposal: Custom schema properties
Martin Aspeli <optilude+lists <at> gmail.com>
2009-11-01 03:30:09 GMT
2009-11-01 03:30:09 GMT
Adam Groszer wrote: > Hello, > > After quickly glancing over plone.behavior it seems more like > something to extend a schema, and does it solve the problem of "new > properties -- new schema -- change everything around it"? > > What I need is to be able to change schema properties per site. And > skipping the need to fix the forms or whatever concerned with that > changed schema. I'm not sure I really understand your problem (from reading the original email), but I maybe offer a few suggestions. plone.behavior is a way to create re-usable chunks of functionality. A behavior may or may not include a schema with form fields, and/or an adapter factory. When the behaviour is "enabled" for an instance (how it is enabled is application-specific: in Plone/Dexterity we list enabled behaviours against each content type), it will be possible to adapt an instance to the behaviour interface, and to look up the schema interface for form rendering, say. There is also a package called plone.autoform, which provides a base class for z3c.form-type forms and enables schemata to be self-describing (e.g. "this field goes before that field", or "this field is only shown if the user has this permission"). plone.autoform interprets these "schema hints" to set up a suitable form. Now, in Dexterity (a content type framework for Plone) we use plone.autoform in such a way that standard add/edit forms are(Continue reading)
RSS Feed