Andreas Jung wrote:
I need to write a custom ZCML directive that takes a list of interfaces - something like

interfaces="Products.Foo.intefaces.IXXX, Products.Foo.interfaces.IYYY,..."

We usually do it without the comma, just separated by whitespace.

What is the recommended way to specify 'interfaces' within the schema
definition (as InterfaceField or as TextLine)?

InterfaceField did not work out-of-the-box complaining about a missing
fromUnicode attribute.

With a TextLine: what is the recommended way to get hold of the interface
represented by a string? Is there some magic available somewhere in Zope 3?

You won't ever have to resolve an interface name yourself. We have fields for this. Here's the field definition for your use case above (multiple interfaces separated by whitespace):


    interfaces = zope.configuration.fields.Tokens(
        title=...,
        description=...,
        required=True,
        value_type=zope.configuration.fields.GlobalInterface()
        )



--
http://worldcookery.com -- Professional Zope documentation and training
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to