Re: [Zope3-Users] Access to persistent Zope tables/classes in ZODB

2006-10-27 Thread Rob J Goedman

Thanks Jim,

I had gotten to the following point (although you have now shown
me a better way to get there, I was using FileStorage):

ZODB.DB.DB object at 0x137e910
{'Application': zope.app.folder.folder.Folder object at 0x1377d70,  
'zope.app.generations': persistent.dict.PersistentDict object at  
0x1377db0}

zope.app.folder.folder.Folder object at 0x1377d70
OOBTreeItems object at 0x1386228

print f1[0].keys()[1]
Rob's buddies
print f1[0].values()[1]
buddydemo.buddy.BuddyFolder object at 0x1377f30
print f1[0].values()[1].__getitem__
	bound method BuddyFolder.__getitem__ of  
buddydemo.buddy.BuddyFolder object at 0x1377f30


This is where I get stuck. Been going over the sources to figure out  
how to iterate over these.


You're 2nd point, about using ZEO, is also very valid (I need to just  
read my 'buddies'  and send the
data down to a bunch of embedded Linux based controllers but the ZODB  
will be locked).


I did notice since I did this, bin/runzope acts differently (on this  
Zope/ZODB?). I created a new instance in 121

and transferred all applications and the new instance works fine:

Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ cd ../121/
Robs-Laptop:~/Projects/Zope/Zope3/121 rob$ runzope
--
2006-10-27T14:45:57 INFO root -- HTTP:localhost:9090 Server started.
Hostname: localhost
Port: 9090
--
2006-10-27T14:45:57 INFO root Startup time: 9.072 sec real, 8.710 sec  
CPU

^C

But the old instance in One2One now just seem to test:

Robs-Laptop:~/Projects/Zope/Zope3/121 rob$ cd ../One2One/
Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$ runzope
--
2006-10-27T14:47:56 WARNING root Developer mode is enabled: this is a  
security risk and should NOT be enabled on production servers.  
Developer mode can be turned off in etc/zope.conf

Total: 0 tests, 0 failures, 0 errors
Robs-Laptop:~/Projects/Zope/Zope3/One2One rob$

Any idea what causes this?

Anyway, thanks again for your quick response!

Rob


On Oct 27, 2006, at 4:41 AM, Jim Fulton wrote:


Rob J Goedman wrote:
I'm wondering if there is an easy way to get to persistent objects  
created in Zope and stored in ZODB

from a python program outside Zope.


Yup.

As an example, I would like to iterate over created 'buddies' in  
buddydemo.


The easiest way is to use zopectl, which takes care of opening the
database(s) and loading the Zope configuration for you.

Interactively, use zopectl debug.  This will give
you an interactive interpreter with an app variable set to
the top-level folder.

Use zopectl run your_script to run a script with the
same app variable set and ready for use.

Of course you can use the lower-level ZODB APIs to open the database
yourself.

Note that you'll want to use ZEO if you want to open the database  
while the

web application is running.

Jim


--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Access to persistent Zope tables/classes in ZODB

2006-10-26 Thread Rob J Goedman

Hi,

I'm wondering if there is an easy way to get to persistent objects  
created in Zope and stored in ZODB
from a python program outside Zope. As an example, I would like to  
iterate over created 'buddies' in buddydemo.


Thanks,
Rob
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] World cookery DynamicSequenceWidget again

2006-10-18 Thread Rob J Goedman
Hi,In trying to work through the PvW book, I get stuck in chapter 7, 2nd part, where the _javascript_/widgets are being introduced. After switching to SequenceWidget, I get to the same behavior/error as in below email but have not been able to find a reply on this email.I've tried both  Zope-3.2.2 and Zope-3.3.0 with Python 2.4.3 on Mac OS 10.4.8. I can't get  Zope3.x.x to build/work with Python-2.5.1) Zope catches an exception in zope.app.publish. Right now I am ignoring this.	( Object: zope.app.folder.folder.Folder object at 0x2a381b0, name: u'favicon.ico' )2) The errata for the PvW book does suggest a fix (for Zope-3.2 at least, defining def __init__), but that does not help.Thanks a lot,RobRe: [Zope3-Users] worldcookery.browser.widget.DynamicSequenceWidgetMarco MarianiTue, 21 Mar 2006 02:57:47 -0800Ulrich P. Klein wrote:How should I modify the custom widget in the recipe examples to make itwork with 3.2.0 ?As it is, the program does not work from chapter 7 onwardI get this on zope.app.form.browser.SimpleInputWidget at every attempt todisplay the widget:    instance = self._widget_factory(*args)TypeError: __init__() takes exactly 4 arguments (3 given)--- browser/widget.py.orig 2004-07-10 17:59:36.0 +0200 +++ browser/widget.py 2006-03-19 18:28:16.0 +0100 @@ -1,9 +1,9 @@ from zope.app import zapi from zope.app.form.interfaces import IInputWidget -from zope.app.form.browser.widget import SimpleInputWidget +from zope.app.form.browser.sequencewidget import SequenceWidget from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile -class DynamicSequenceWidget(SimpleInputWidget): +class DynamicSequenceWidget(SequenceWidget): """Widget for (simple) sequences that does not require the form to be reloaded for every change."""Close, but it still doesn't work.The widget is displayed and works on the client, but I am unable to insert ingredients. Every time I click 'add' on the form, the ingredients list comes back empty and the recipe is refused (an error occured; there are 1 input errors).___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users