[Zope] passing values tp python script from a zope page template through a link

Laura McCord Laura.McCord at doucet-austin.com
Fri Aug 27 16:37:55 EDT 2004


I wrote a xmlrpclib server and client file but this is the first time I
am trying to pass a value from my zope page template to my python script
that executes a server sub routine.

Also, the python function should be triggered by a link. This is what I
have so far:

python script:

def deleteHost():
 server=xmlrpclib.Server("http://localhost:8080/RPC2")
 delete = server.sample.DeleteHost()
 return

server script:
  sub DeleteHost(){
      my ($pcName) = @_;
      my ($name) = "'" . $pcName . "'";                    
      my $delete = "Delete from Host where SystemNetName = $name";
      print "$delete\n";      
      if ($db->Sql($delete)){
          print "Error on SQl DELETE\n";
          Win32::ODBC::DumpError();    
      }
      else
      {
          print "delete successful\n";
      }
     }

I am not sure how to pass the value pcName from the zope page template.

Any suggestions?

-Laura


More information about the Zope mailing list