Is there a way to look at the "raw" data making up an object in the ZODB?
I have a suspicion that earlier version of one our my products may have set an attribute to a large value. The newer versions of the Product no longer do it, but if some of the objects are still around from previous versions, wouldn't they still have the old attribute in the ZODB? Is there a way to look at what an object looks like in the ZODB and find out what attributes it has, without knowing the name of this now-defunct attribute? I realize this question is odd, and I hope I have explained clearly enough what is I want. Let me know if I can provide any more details, John Ziniti
John Ziniti wrote:
Is there a way to look at what an object looks like in the ZODB and find out what attributes it has, without knowing the name of this now-defunct attribute?
Open up zope from the command prompt and look at the object and use dir to introspect it: $ /var/zope/bin/zopectl debug Starting debugger (the name "app" is bound to the top-level Zope object)
app.objectIds() ['acl_users', 'Control_Panel', 'temp_folder', 'browser_id_manager', 'session_data_manager', 'error_log', 'index_html', 'standard_error_message', 'standard_html_footer', 'standard_html_header', 'standard_template.pt', 'Plone', 'alter', 'ZChecker'] dir(app.Plone) ['COPY', 'COPY__roles__', 'DELETE', 'DELETE__roles__', 'HEAD', 'HEAD__roles__', 'LOCK', 'LOCK__roles__', 'MKCOL', 'MOVE', 'MOVE__roles__', 'OPTIONS', 'OPTIONS__roles__', 'PROPFIND', 'PROPFIND__roles__', 'PROPPATCH', 'PROPPATCH__roles__', 'PUT', 'REQUEST', 'TRACE', 'TRACE__roles__', 'UNLOCK', 'UNLOCK__roles__', '__ac_permissions__', '__allow_access_to_unprotected_subobjects__', '__basicnew__',
-- Andy McKay ClearWind Consulting http://www.clearwind.ca
Andy McKay wrote:
John Ziniti wrote:
Is there a way to look at what an object looks like in the ZODB and find out what attributes it has, without knowing the name of this now-defunct attribute?
$ /var/zope/bin/zopectl debug Starting debugger (the name "app" is bound to the top-level Zope object)
dir(app.Plone)
Thanks, Andy. That's pretty neat. It's never been easier!! Now getting to the meat of the problem I have: I've located the name of the attribute that is too large. The problem is that I've been unable to get rid of the attribute completely. I've used a "del" in my __setstate__, I've restarted Zope completely, and I've packed the database. When I use the debugger as above, the attribute that I got rid of is no longer there, but when I export the object from the ZMI, the .zexp is 500 KB, and I can see the name of the attribute in the .zexp. Why is this attribute still hanging around? Thanks in advance, JZ
participants (2)
-
Andy McKay -
John Ziniti