[Zope] simple python question

Charlie Reiman creiman@kefta.com
Thu, 26 Sep 2002 12:56:19 -0700


Probably not. I'm not familiar with XML document but I'm pretty sure you'll
have to find something in that if you want to update the body.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Sushil Bhattarai
> Sent: Thursday, September 26, 2002 11:13 AM
> To: creiman@kefta.com
> Cc: zope@zope.org
> Subject: RE: [Zope] simple python question
>
>
> Thanks, it works.
>
> One more question, instead of adding XML Document object everytime, I want
> to update the content of same document. Can I do
> xml = self.manage_addProduct['XMLDocument'].edit('xxx', 'XXX', str(token))
>
> Sushil
>
> > I'm not entirely clear what you're asking but I suspect this will work:
> >
> > xml = self.manage_addProduct['XMLDocument'].add('xxx', 'XXX',
> > str(token))
> >
> > When writing products, I had to keep calling str() on things since they
> > were usually acquisition wrappers. It gets quite annoying.
> >
> > If it does fix your problem, foward this to the list so folks know your
> > problem is solved.
> >
> >> -----Original Message-----
> >> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> >> Sushil Bhattarai
> >> Sent: Thursday, September 26, 2002 10:19 AM
> >> To: zope@zope.org
> >> Subject: [Zope] simple python question
> >>
> >>
> >> I'm absolutely new to python, so please help me out
> >>
> >> I have this calculator2 function which calls the webservice and gets
> >> token as a XML file. At the same time I'm creating an XML Document
> >> (with is xxx and title XXX). I want to feed the xml content I'm
> >> getting (in this case token) into the XML document I'm creating. If I
> >> hard code the xml text in quotes it works. But I want to feed the text
> >> I'm getting in as token. What is the proper syntax to do that?
> >>
> >> def calculator2(self, REQUEST, RESPONSE):
> >>  ssfService = ServiceProxy
> >> ('http://localhost.ssc.com:8080/ssfsoap/services/CalcService?WSDL')
> >>  token = ssfService.addInt(3,8)
> >>  REQUEST.set('token1', token)
> >>  xml = self.manage_addProduct['XMLDocument'].add('xxx', 'XXX', REQUEST
> >> ['token1'])
> >>  return token
> >>
> >> --
> >> Sirvisetti Systems
> >> 347 Plainfield Avenue
> >> Edison, NJ 08817
> >> (732) 985-2200
>
>
> --
> Sirvisetti Systems
> 347 Plainfield Avenue
> Edison, NJ 08817
> (732) 985-2200