[Zope3-dev] Circular references between interfaces

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Oct 8 07:43:53 EDT 2004


On Friday 08 October 2004 00:04, Peter Mayne wrote:
> IActor.movies = List(
>          title = u'Movies',
>          description = u'Movies this actor has been in.',
>          value_type = Object(IMovie, title = u'Movie reference'),
>          default = [],
>          required = False)

This is an incorrect assignment. You cannot simply use the attribute 
assignment syntax on interfaces. I guess the best way would be:

class IActor(Interface):
     '''Actor definition.'''

     movies = List(
         title = u'Movies',
         description = u'Movies this actor has been in.',
         value_type = Object(Interface, title = u'Movie reference'),
         default = [],
         required = False)

class IMovie(Interface):
    ...

IActor.getDescriptionFor('movies').value_type.schema = IMovie

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-dev mailing list