[BlueBream] [Zope-dev] getting size of zope.schema.List from a view in bluebream

Joshua Immanuel josh at hipro.co.in
Tue Aug 23 09:00:39 EDT 2011

Hello Adam,

Thanks for the reply.

On Tue, 2011-08-23 at 14:39 +0200, Adam GROSZER wrote:
> Well using removeSecurityProxy is not so nice.
> If there's really a list in your property, then zope should give you 
> zope.Public access:
> _default_checkers = {
> ...
>      list: NamesChecker(['__getitem__', '__getslice__', '__len__', 
> '__iter__',
>                          '__contains__', 'index', 'count', '__str__',
>                          '__add__', '__radd__', ]),
> ...
> Can you do:
>            from zope.security.proxy import removeSecurityProxy
>            li = removeSecurityProxy(self.context.list_field)
>           print type(li) 

As I am using the persistent List in the implementation of IMyObject,
the output of the above is

        <class 'persistent.list.PersistentList'>
So, How can I access its inbuilt methods without removing the security
proxy. Please guide me.

Joshua Immanuel
HiPro IT Solutions Private Limited
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/bluebream/attachments/20110823/f1661a4d/attachment.bin 

More information about the bluebream mailing list