[Zope3-dev] Interface field type

Jim Fulton jim at zope.com
Sun Nov 14 14:34:43 EST 2004


Shane Hathaway wrote:
> Today I wrote a containerViews directive and accidentally pointed the
> "for" attribute at a class rather than an interface. 

It should be legal to provide a class rather than an interface.
This should be reported as a bug.

 > Zope blew up when
> trying to build the ZMI menu.  The error was confusing and not related to
> the real problem.
> 
> So I'm thinking that in addition to the GlobalObject field type, there
> should also be a GlobalInterface field type. 

I don't think this is necessary.

 > Alternatively, uses of
> GlobalObject that expect an Interface should pass a value_type that checks
> for interfaces.  Which would be better?

I think the latter. The GlobalObject value_type
attribute exists to handle this case, by supplying InterfaceField.

Note again, however that a class should be allowed in this
case.

Jim


More information about the Zope3-dev mailing list