[Erp5-dev] Modifying ZODB from zopectl debug - is it possible?

Pelletier Vincent vincent at nexedi.com
Mon Sep 24 15:27:50 CEST 2007


Le Lundi 24 Septembre 2007 15:01, Łukasz Nowak a écrit :
> >>> r.setTitle('Testing...1...2...3')

At this step, you modify the 'r' document, which causes an activity to be 
created to reindex the object. But the activity is kept in a buffer unitll 
transaction is actually commited...

> >>> get_transaction().commit()
[...]
> "/home/shufla/work/erp5instance/Products/CMFActivity/ActivityBuffer.py",
> line 165, in tpc_prepare
>     activity.prepareQueueMessageList(self._activity_tool, message_list)

Now the transaction is being commited, and activity buffer gets flushed to SQL 
tables (in the SQLDict and SQLQueue cases).

>   File
> "/home/shufla/work/erp5instance/Products/CMFActivity/Activity/SQLDict.py",
> line 98, in prepareQueueMessageList
>     activity_tool.SQLDict_writeMessageList( uid_list = uid_list,
> AttributeError: SQLDict_writeMessageList

But to do so it requires to access some ZSQLMethods which are in portal_skins, 
and fails to access them.

There are multiple things which are usualy setup when site is accessed through 
regular path which might be missing in your case, causing that error.
If you want to modify things by hand and are able to access your site in a 
"regular" way, you might want to invoque pdb [1].

If not, you will probably have to find out what needs to be initialised.
There is something initialized in the REQUEST object by portal_skins which 
tells the skin selection used, but there should be a fallback on "View", 
which should contain "activity" skin folder, hence allowing to access 
SQLDict_writeMessageList and the like.

[1] http://www.erp5.org/Discussion/TestingIdeas?highlight=%28pdb%29

-- 
Vincent Pelletier



More information about the Erp5-dev mailing list