[Zope3-Users] Create and Delete object from command line.

Gary Poster gary at zope.com
Thu Oct 6 23:55:14 EDT 2005


On Oct 6, 2005, at 11:42 PM, Nicolas Legault wrote:

> I need to create object in Zope3 like clicking in the Add section and
> filling the "Add form" via a python script that will be called from  
> the
> command line. This script will add many or remove instance of  
> different
> object in Zope3
>
> Up to day I've not come to understand a way to do this.
>
> Is there any information about a way to do this ?

There are a couple of ways to approach this, depending on your  
needs.  I'm assuming that Zope needs to be serving to other users at  
the same time, in a more typical client-server role.

One approach is to run Zope 3 with ZEO, and write a script that  
connects to the database via ZEO and modifies the database as you  
need.  This bypasses security, and requires that the script have  
access to the (sensitive) ZEO port of your Zope.

Another approach would be to have a view--XML-RPC, maybe.  Have the  
script make a request with authentication and the necessary  
information to create your object, then have your view do the work.

If I'm not guessing your needs correctly, you'll need to specify a  
bit more.

Gary


More information about the Zope3-users mailing list