Hi,

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()
> 
> <class class=".chat.Chat">
>     <require permission="zope.View" interface=".interfaces.IChat" />
>     <require permission="zope.View" set_schema=".interfaces.IChat" />
> </class>

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.

Regards,

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

Reply via email to