[Zope3-Users] Using metadata and __name__ in addform

Florian Lindner mailinglists at xgm.de
Thu May 12 17:20:45 EDT 2005


Am Donnerstag, 12. Mai 2005 15:52 schrieb Fred Drake:
> On 5/11/05, Florian Lindner <mailinglists at xgm.de> wrote:
> > factory = annotatableadapter.partialAnnotatableAdapterFactory(["title"])
> >
> > I'm not sure where to place this call (in the interface, in the
> > implementation, in which function, ...) and what to do with the factory
> > variable. Is there a real example for that? Besides the tests in
> > partial.txt.
>
> Here, "factory" is a new IZopeDublinCore factory.  It should be
> registered as the adapter for the relevant content type via ZCML:
>
>     <adapter
>         for=".impl.MyContentClass"
>         provides="zope.app.dublincore.interfaces.IZopeDublinCore"
>         factory="impl.factory"
>         />
>
> Does this help?

Yeah, I think I got the point...

Pretty much to write. What do you think about the idea to create a new field 
type (something like Text, TextLine, Choice) named DCTitle for example which 
is derived from TextLine but always mirrors the DC Title metadata. So I could 
define a field in a scheme like that:


    name = DCTitle(
        title = u"My DC title field",
        description = u"This mirrors the DC title field",
        required = True   # or False
        )

What do you think about that?

Florian


More information about the Zope3-users mailing list