[Zope] External Methods

Marcus Mendes mvmendes@emdata.com.br
Fri, 05 Jan 2001 17:51:04 +0000


"Ryan M. Dolensek" wrote:
> 
> Try...
> 
> for k,v in form.items():
>   k should contain the key name
>   v should contain the value
> 
> Otherwise...
> 
> value = form['Name_Of_Variable_OF_my_form']
> 
> Hope that helps.
> 
> Ryan
> 
> > Hello,
> >
> > Ok Sirs, I'm very late in my checking my mailbox ;-)
> >
> > I've a question in this code above : How can I get the values of a
> > dictionary form?
> > In my Method, I used form.values(), form.Name_Of_Variable_OF_my_form,
> > but it is not working.
> >
> > Thanks
> >
> > Marcus Mendes
> >


Hello again,

I've got the follow content : Key Error SERVER_NAME, that is, 
Look at my code, please:



def log_info(REQUEST):
    if REQUEST is None:
       REQUEST=self.REQUEST 
    form= REQUEST.form 

    try: log=open('/home/mvmendes/testes_zope/log.txt', 'a')
    except IOError:
      log=open('/home/mvmendes/testes_zope/log.txt', 'w')
    server = form['SERVER_NAME']
    connection = form['CONNECTION_TYPE']
    line='Server: %s, Connection type : %s\n' % ( server, connection )
    log.write(line)
    log.close()
    return


I calling my external method using : <dtml-call "grava_arq(REQUEST)">
I also tried with "for" command but isn't working.

Can you help me?

Thanks in advance.

Marcus Mendes