[Zope] eval in PyScript

Janko Hauser jhauser@ifm.uni-kiel.de
Tue, 18 Jun 2002 01:17:33 +0200


eval() is not save for TTW (through the web) programming.
Generally one can make an external method and call it from TTW code.

On Mon, 17 Jun 2002 03:38:28 -0700
Aseem Mohanty <aseem@neurobehavioralsystems.com> wrote:

> req=container.REQUEST
> if req.has_key(field_name):
>     val = eval('req.'+field_name)
>     if val != None: return val
> return ''

use req.get(field_name), no need to use an unsafe eval.

HTH,
__Janko


-- 
i.A. Dr. Janko Hauser
Software Engineering
c o m . u n i t   G m b H
online-schmiede seit 1994

http://www.comunit.de/	mailto:jh@comunit.de
Eiffestr. 598		20537 Hamburg | Germany
Fon 040 | 21 11 05 25	Fax  040 | 21 11 05 26