Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



python+zope++:: Zope debug and zeo
Posted at 22.Feb,2008 12:38  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

I'm managing one site that was started with zope2.0.x and most contents are in ZClasses.

During the transitions between zope2.0.x to zope2.8.x over the years, many things changes, but the main ZClass still works. I haven't yet moved the ZClass to product for this site, and now I'm having ZClasses biting me.

The ZClass, let's call it X, was done in end of 99, early 2000, and I was such a newbie, I inherited many Classes and ZClasses as X's Base Class.

Now I cannot access the Advanced tab in ZSQL Method. It seems that advanced tab looks for any ZClass to load, and one of the ZClass was unloadable.

I can't set the max rows, cache time, etc.

Or can't I?

Here's the best thing. With ZEO, i can attach to zope via a zeo client (by running bin/zopectl debug), go to said object, and change the parameters, commit and be done with it.

Here's how::

  • setup your zeo environment if you haven't already
  • start zope in debug:
           $>bin/zopectl debug
           Starting debugger (the name "app" is bound to the top-level Zope object)
    
  • get our root object, which is app:
           >>> root = app
    
  • get our object, which is the ZSQL Method:
            >>> o=root.unrestrictedTraverse('/urlpath/to/our/object)
    
  • change the parameters:
    
    

>>>o.manage_advanced(connection_hook='',max_rows=1000,max_cache=100,cache_time=600,class_name='',class_file='')

  • import transaction (should be done once) to commit the changes:
         >>>transaction.commit()
    

we're done


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/180/tbping 

Comments
Post a comment