[Zope3-Users] proxied list object in a schema

FB fbo2 at gmx.net
Sun Dec 17 15:57:08 EST 2006


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


More information about the Zope3-users mailing list