[Zope] Inconsistent _object contents

Jens Vagelpohl jens at zope.com
Sun Dec 28 14:23:42 EST 2003


Why exactly are you using the _objects attribute directly? If you 
subclass from something like Folder you should use the API they have, 
such as objectIds or whatever you need.

jens


On Dec 28, 2003, at 14:17, Michael Long wrote:

> Hi,
>
> Sorry for the incomplete posting. I hit the wrong hotkey :(
>
> I have a product with an folderish object. When examining the contents 
> of the
> _objects attribute I see the following behavior when calling the 
> following function
> through the ZMI.
>
> def test(self):
>   """ """
>   return self._objects
>
> No items ==> nothing returned
> 1 *Folder* item ==> ({'meta_type': 'Folder', 'id': 'Folder'},)
>
> 2 *Folder* items ==> {'meta_type': 'Folder', 'id': 'folder1'}
>
> 3 *Folder* items ==> ({meta_type': 'Folder', 'id': 'Folder'}, 
> {'meta_type':
> 'Folder', 'id': 'folder2'})
>
> Is this correct behavior? If you delete all but one item _object will 
> contain a
> sequence of dictionaries instead of a dictionary only. Delete that 
> last item and
> start over and you will get the behavior shown above.
>
> Environment:
>     Windows XP Pro
>     Zope 2.7.0-b3
>     Python 2.3.2
>
> Thanks,
> Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2355 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20031228/d334a988/smime.bin


More information about the Zope mailing list