Eric Bréhault wrote:
Hello,
What about just doing the import yourself: container._importObjectFromFile(f)
(rather than using the ZMI's manage_importObject method through a zope client connection) ?
Eric BREHAULT
On 3/12/07, Fabio Marcone <fabio.marcone@duet.it> wrote:
Jens Vagelpohl wrote:
I have a problem using manage_importObject?file=... with zope2.9. In particular: object is successfully imported but if I shutdown and then reboot the server, I don't see anymore imported object. If I import the same object using web form "Import/Export" I have not this strange behavior.
Are you calling manage_importObject from Python code? Are you sure the transaction is committed? If you're calling this in some external script (such as a script run via "zopectl run") without starting a "normal" web request you may have to explicitly commit the transaction.
jens
perhaps this is the problem... in fact /var/lib/zope2.9/instance/myinstance/var is empty after importObject operation using python script.
but the commit has been introduced in zope 2.9? I use the same code in zope2.7 without problem. in a python script I use: zopeClient(' http://localhost:9673/manage_importObject?file=app.zexp',myuser,mypassword
)
where zopeClient is: def zopeClient(url,username,passwd): f = Function(url) f.username = username f.password = passwd apply(f,(),{})
How I can do "commit"?
Thanks, Fabio
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
--
Dott. Fabio Marcone
2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424 _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
well, I have no container because my script python is not an external method or a script python in zope. I try with: import Zope2 Zope2.configure(...) app=Zope2.app() app.manage_delObjects(ids="index_html") app.manage_importObject("index_html.zexp") but with no results Now I'm trying with urllib2 and urlopen with authentication but when I reboot the machine, zope application disappeared. do you know a method to commit http transaction in zope? any suggests? Thanks, Fabio -- Dott. Fabio Marcone 2T srl Telefono +39 - 0871- 540154 Fax +39 - 0871- 571594 Email fabio.marcone(AT)duet.it Indirizzo Viale B. Croce 573 66013 Chieti Scalo (CH) GNU/Linux registered user #400424