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

2011-08-23 Thread Adam GROSZER
Hello, You forgot to paste interfaces.IMyObject definition. On Tue, 23 Aug 2011 13:16:24 +0530 you wrote: Hello all, While trying to get the length of zope.schema.List field in a view (like this: len(self.context.list_field) I get the following error ForbiddenAttribute:

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

2011-08-23 Thread Joshua Immanuel
Hello all, On Tue, 2011-08-23 at 13:16 +0530, Joshua Immanuel wrote: def getListSize(self): return len(self.list_field) This solves my issue. This solves just the '__len__' issue. But if do the slice operation like this

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

2011-08-23 Thread Charlie Clark
Am 23.08.2011, 13:34 Uhr, schrieb Joshua Immanuel j...@hipro.co.in: This solves just the '__len__' issue. But if do the slice operation like this self.context.list_field[offset:limit] I get the following error ForbiddenAttribute: ('__getslice__',[...]) I guess my approach is

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

2011-08-23 Thread Joshua Immanuel
Hello Charlie, Thanks for the reply. On Tue, 2011-08-23 at 13:56 +0200, Charlie Clark wrote: I think it's really difficult to work out what you are trying to do. Please state your problem more clearly. Are you still using zope.form or are you using z3c.form? I am still using zope.formlib.

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

2011-08-23 Thread Adam GROSZER
Hello, 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__',

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

2011-08-23 Thread Joshua Immanuel
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: