[Zope] using getProperty and catching Unauthorized

Dieter Maurer dieter@handshake.de
Fri, 25 Oct 2002 21:37:53 +0200


Casey Duncan writes:
 > I think the following should do what you want:
 > 
 > for foo in bar.objectvalues()
 >     try:
 >         mo = foo.getProperty('menu_order', None)
 >     except 'Unauthorized':
 >         continue
 >     ..do stuff..
It may not work, because Python uses "is" to check against string
exceptions and not "==".


Dieter