[Zope3-Users] Interfaces in Schemas

Martin Aspeli optilude at gmx.net
Wed Apr 18 12:21:45 EDT 2007




Hermann Himmelbauer wrote:
> 
> Hi,
> I wonder if it's possible to define attributes in a schema that reference 
> other interfaces. For instance, I have a schema for a car and another one
> for 
> a wheel and what I want to do is something like that:
> 
> class IWheel(Interface):
>        type = TextLine()
> 
> class ICar(Interface):    
>     
>        model = TextLine()
> 
>        wheel = ??? of type IWheel ???    
> 

wheel = schema.Object(schema=IWheel)



> or even better:
>        wheel = List(min_length=4, max_length=4, 
>                             value_type = ??? of type IWheel???)
> 

value_type=schema.Object(schema=IWheel)



> What would be really great now is if formlib could handle this and would 
> automatically set up the needed widgets.
> 

Not sure what it does; I think you'd need to write some custom reference
widget type thing; you can't "fill in a wheel", really. :) Where would the
Wheel objects come from?

Martin
-- 
View this message in context: http://www.nabble.com/Interfaces-in-Schemas-tf3601683.html#a10061121
Sent from the Zope3 - users mailing list archive at Nabble.com.



More information about the Zope3-users mailing list