[Zope] Accessing CURRENT property

Chris Withers chris at simplistix.co.uk
Wed Oct 5 04:39:06 EDT 2005


Peter Bengtsson wrote:
> Not sure what it's called in Page Templates or Python Scripts but in
> DTML it's called careful_hasattr() which wraps hasattr() in a
> restricted context.

I wouldn't trust that either ;-)

hasattr's insane in that it catches prettymuch all exception, including 
ConflictErrors...

I much prefer get patterns of getattr(something,'something',None) or 
variants thereof, depending on the situation...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope mailing list