[Zope] interating though REQUEST.form in python???

Kevin Howe support@performance-net.com
Tue, 8 Aug 2000 17:21:49 -0300


Yes, when I use this I get the following error:

Error Type: TypeError
Error Value: loop over non-sequence

Kevin

----- Original Message -----
From: "peter be" <peter@grenna.net>
To: "Kevin Howe" <support@performance-net.com>
Sent: Tuesday, August 08, 2000 5:05 PM
Subject: SV: [Zope] interating though REQUEST.form in python???


>
> Have you tried?:
>
> for name,value in REQUEST.form.keys:
>     # kewl stuff
>
>
> ----- Original Message -----
> From: Kevin Howe <support@performance-net.com>
> To: ZOPE Mailing List <zope@zope.org>
> Sent: Tuesday, August 08, 2000 8:16 PM
> Subject: [Zope] interating though REQUEST.form in python???
>
>
> > I'm trying to do a FOR statement to loop though items in a REQUEST, but
keep
> > getting errors:
> >
> > def myMethod(self,REQUEST):
> >   for name,value in REQUEST.form:
> >     # do this
> >
> > I've tried variations:
> >
> > for name,value in REQUEST.items:
> > for item in REQUEST.form.items:
> > for key in REQUEST.keys:
> >
> > but none seem to work.
> >
> > When I used "return REQUEST.form", a Dictionary was displayed like so:
> >
> >   {'item': 'val1', 'item2':'val2', etc.}
> >
> > so I tried fetching it as a plain dictionary:
> >
> >   form = REQUEST.form
> >   return form.keys
> >
> > but no luck.
> >
> > Is it not possible to access the REQUEST methods via python?
> >
> > Kevin
> >
> >
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
>