[Zope3-Users] Own packages corrupts ZODB

Roger Ineichen dev at projekt01.ch
Fri Dec 10 21:30:16 EST 2004


Hi Florian

Is the Centershock class really a container?

You declare it as a container in:
<implements 
   interface="zope.app.container.interfaces.IContentContainer"
   />

This returns the ReadContainerXmlObjectView of the ZMI tree.
This view will read the len of your container.

It could be, that you don't have a container or at least no permission
for accessing __len__. 

If your object is a container make sure you have permissions for the 
IReadContainer methods of the container part.

Regards
Roger Ineichen

Projekt01 GmbH
www.projekt01.ch
_____________________________
END OF MESSAGE  

> -----Original Message-----
> From: zope3-users-bounces at zope.org 
> [mailto:zope3-users-bounces at zope.org] On Behalf Of Florian Lindner
> Sent: Friday, December 10, 2004 9:02 PM
> To: zope3-users at zope.org
> Subject: [Zope3-Users] Own packages corrupts ZODB
> 
> Hello,
> I've created a new package which causes a system error very 
> time the ZMI 
> folder listing of the folder which contains an instance of 
> the object is 
> listed:
> 
> The traceback is:
> 
> Traceback (innermost last):
>    Module zope.publisher.publish, line 138, in publish
>      result = publication.callObject(request, object)
>    Module zope.app.publication.zopepublication, line 153, in 
> callObject
>      return mapply(ob, request.getPositionalArguments(), request)
>    Module zope.publisher.publish, line 113, in mapply
>      return debug_call(object, args)
>     - __traceback_info__: <bound method 
> ReadContainerXmlObjectView.singleBranchTree of 
> <zope.app.publisher.browser.viewmeta.ReadContainerXmlObjectVie
> w object 
> at 0x00E2AEB0>>
>    Module zope.publisher.publish, line 119, in debug_call
>      return object(*args)
>    Module zope.app.rotterdam.xmlobject, line 133, in singleBranchTree
>      name, len(subItem), iconUrl))
> ForbiddenAttribute: ('__len__', 
> <CS.centershock.centershock.Centershock 
> object at 0x01212EF0>)
> 
> 
> I have no idea what can cause this.
> The only special thing is that the interface has no members:
> 
> 
> from zope.interface import Interface
> from zope.app.container.interfaces import IContained
> 
> class ICentershock(IContained):
>      """Main component"""
> 
>      def __setitem__(name, object):
>          """Add a ICentershock object."""
> 
> 
> The registration:
> 
> 
> 
> <configure xmlns="http://namespaces.zope.org/zope">
> 	<include package=".browser" />
> 	
> 	<interface interface=".interfaces.ICentershock" 
> type="zope.app.content.interfaces.IContentType" />
> 	<content class=".centershock.Centershock">
> 		<implements 
> interface="zope.app.annotation.interfaces.IAttributeAnnotatable" />
> 		<implements 
> interface="zope.app.container.interfaces.IContentContainer" />
> 		<factory description="centershock.net"/>
> 		<require permission="zope.Public" 
> interface=".interfaces.ICentershock" />
> 		<require permission="zope.Public" 
> set_schema=".interfaces.ICentershock" />
> 	</content>
> 	
> </configure>
> 
> the package browser registration:
> 
> <configure xmlns="http://namespaces.zope.org/browser">
> 	<addMenuItem
> 		class="..centershock.Centershock"
> 		title="centershock.net"
> 		description="A centershock.net object"
> 		permission="zope.ManageContent"
> 	/>
> 
> 	<editform
> 		schema="..interfaces.ICentershock"
> 		label="Change centershock.net information"
> 		name="edit.html"
> 		permission="zope.ManageContent"
> 		menu="zmi_views" title="Edit"
> 	/>
> 
> 	<containerViews
> 		for="..interfaces.ICentershock"
> 		index="zope.Public"
> 		contents="zope.Public"
> 		add="zope.ManageContent"
> 	/>
> </configure>
> 
> 
> what is wrong with that?
> 
> Thanks,
> 
> Florian
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
> 



More information about the Zope3-users mailing list