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

Joshua Immanuel <[email protected]>
Newsgroups gmane.comp.web.zope.bluebream,gmane.comp.web.zope.devel
Organization HiPro IT Solutions Private Limited
Message-ID <1314104439.2450.122.camel@jimman>
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.

Regards
-- 
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAk5TpHYACgkQWw85XwuSFMIJkwCfffYFSKks337h+VlNvy6lveeD
WSYAoJLbOfF+uQ/4Fb0ZGQ+0a53N7/Jp
=K23s
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.