Hi Zopists, I would like to know how to connect to running Zope ZODB from a python script. I would like to have possibility to read only objects from ZODB? Is there any possibility how to do it when Zope application server is running and not to corrupt the ZODB? Thanks, Petr -- Petr Knápek NEXTRA Czech Republic, s.r.o., Hlinky 114, 603 00 Brno, Czech Republic e-mail: mailto:petr.knapek@nextra.cz tel:+420-5-43 554 150 FAX:+420-5-43 554 214
Petr Knapek wrote:
I would like to know how to connect to running Zope ZODB from a python script. I would like to have possibility to read only objects from ZODB? Is there any possibility how to do it when Zope application server is running and not to corrupt the ZODB?
This was asked on the zope-dev@zope.org list only a few weeks ago. You can look up the discussion in the list archives. The best solution is for you to use ZEO, and write your python object-reader as a ZEO Storage Client. I believe this is easier than it might sound, although I haven't tried it myself. (did I get the terminology right?) -- Steve Alexander Software Engineer cat-Box limited http://www.cat-box.net
Steve Alexander wrote:
Petr Knapek wrote:
I would like to know how to connect to running Zope ZODB from a python script. I would like to have possibility to read only objects from ZODB? Is there any possibility how to do it when Zope application server is running and not to corrupt the ZODB?
This was asked on the zope-dev@zope.org list only a few weeks ago. You can look up the discussion in the list archives.
The best solution is for you to use ZEO, and write your python object-reader as a ZEO Storage Client.
I believe this is easier than it might sound, although I haven't tried it myself.
(did I get the terminology right?)
Yep, and it's actually *really* easy. Once you have your Zope running on ZEO, you just write a script with these two lines: import Zope app = Zope.app() Now "app" refers to the root folder. Read and change objects to your heart's content. (Seriously!) Then just call: get_transaction().commit() It can't get any easier than that. You can even do all this using the interactive prompt. Shane
Hi Petr, Look into ZEO. You'll be able to connect to a ZODB database from multiple processes with ZEO. - C ----- Original Message ----- From: "Petr Knapek" <knapek@knapek.pvt.net> To: <zope-dev@zope.org> Sent: Thursday, February 15, 2001 11:34 AM Subject: [Zope-dev] How to read ZODB with Python script? Hi Zopists, I would like to know how to connect to running Zope ZODB from a python script. I would like to have possibility to read only objects from ZODB? Is there any possibility how to do it when Zope application server is running and not to corrupt the ZODB? Thanks, Petr -- Petr Knápek NEXTRA Czech Republic, s.r.o., Hlinky 114, 603 00 Brno, Czech Republic e-mail: mailto:petr.knapek@nextra.cz tel:+420-5-43 554 150 FAX:+420-5-43 554 214 _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
http://www.kuchling.com/zodb/guide/ -Michel On 15 Feb 2001, Petr Knapek wrote:
Hi Zopists,
I would like to know how to connect to running Zope ZODB from a python script. I would like to have possibility to read only objects from ZODB? Is there any possibility how to do it when Zope application server is running and not to corrupt the ZODB?
Thanks, Petr
participants (5)
-
Chris McDonough -
Michel Pelletier -
Petr Knapek -
Shane Hathaway -
Steve Alexander