[Zope] contrext.REQUEST and hasattr

Geir Bækholt Geir Bækholt
Thu, 8 Aug 2002 22:28:12 +0200


Hello Bryan, 
Thursday, August 8, 2002, 9:35:26 PM, you wrote:
BCA> Trying to use this bit of code in a Python script:
BCA> if not hasattr(context.REQUEST,'learners')
BCA> I get a a KeyError for for learners. Am I missing something, because this is
BCA> exactly what hasattr is supposed to be used for.

try context.REQUEST.has_key('learners') instead
REQUEST is a lot like a dictionary..
:)

-- 
Geir Bækholt                       web-developer
geirh@funcom.com             funcom oslo | webdev-team