Extending a content type with additional fields in Zope 3, using annotations
I got a question today from one of my zope 3 "pupils": how do I extend the schema for an object that belongs to a package over which I have no control? The purpose is not exactly to extend the schema, but to make it easy to create formlib based forms for that object.
The answer is of course easy using one adapter and annotations: create a new schema that contains the extra field and create an adapter that stores the extra field as an annotation to the schema. Then, in the formlib forms, when defining the form_fields, also add the fields of the newly created interface. Then the adapter will be "automagically" used to edit the object, in the form handling.
TODO: code to exemplify this.