On Sun, Dec 17, 2006 at 09:57:08PM +0100, FB wrote:
> On Sun, Dec 17, 2006 at 02:21:03PM +0100, Tim Terlegård wrote:
> > Would someone like to explain how to use a list in a schema object
> > without getting ForbiddenAttribute? This is my use case.
> > 
> > class IChat(Interface):
> >     messages = Attribute('Chat messages')
> > 
> > class Chat(Persistent):
> >     def __init__(self):
> >         self.messages = persistent.list.PersistentList()
> 
> try that:
> 
> class MyList(persistent.list.PersistentList):
>    pass
> 
> <class class=".MyList">
>    ...
> </class>
> 
> You should find the necessary interfaces for your <require>s in
> zope.interface.common.mapping.

This worked very well. I used ISequence from
zope.interface.common.sequence. The good part is that I now understand
why it should be done this way. Thanks.

Tim
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to