[Zope3-Users] Re: A gentle push in the right direction needed

Philipp von Weitershausen philipp at weitershausen.de
Wed Jul 19 19:01:39 EDT 2006


Tim Penhey wrote:
>     postal_address = InterfaceField(
>         title=u"Postal Address"
>         )

Use zope.schema.Object here:

  postal_address = Object(
      title=u"...",
      schema=IAddress
      )

You can then have the this subobject's widget rendered as a subform by
the ObjectWidget. You'll have to give ObjectWidget a constructor that it
will call in case it has to create an IAddress object.

> Now it is with the postal_address I hit my first snag.  I really want to say 
> that it is an IAddress.  Am I using InterfaceField correctly here?  Is there 
> an option to specify the type of the interface?
> 
> Also how do I specify a list of addresses?

  addresses = List(
      title=u"...",
      value_type=Object(schema=IAdress),
      )

Philipp



More information about the Zope3-users mailing list