[Zope] eval in PyScript

Chris Beaven Chris@d-designz.co.nz
Tue, 18 Jun 2002 10:56:59 +1200


Try this way:

req=container.REQUEST
if req.has_key(field_name):
    val = req[field_name]
    if val != None: return val
return ''





-----Original Message-----
From: Aseem Mohanty [mailto:aseem@neurobehavioralsystems.com]
Sent: Monday, 17 June 2002 10:38 p.m.
To: zope@zope.org
Subject: [Zope] eval in PyScript


I cant seem to be able to call eval() from my script... Do I have to do 
something special to make it happen?

The error:

Error Type: NameError
Error Value: global name 'eval' is not defined

the script:

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



TIA
AM

-- 
==================================================================
 Aseem Mohanty							   
 Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 
 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231		  	
==================================================================

 "I saw `cout' being shifted "Hello world" times to the left and  
  stopped right there!!"                        -- Steve Gonedes  
================================================================== 




_______________________________________________
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 )