8 Jun
2001
8 Jun
'01
6:18 p.m.
Anders Schneiderman writes:
... determining that an object has an unacquired attribute ... This is currently not easy.
You can try: <dtml-if "_.has_key(aq_explicit,'front_page')"> ... This will often work, but sometimes give false "true" results. A safe method is to write an External Method "has" with the following code: def has(object,attr): object= getattr(object,'aq_base',object) return hasattr(object,attr) and use is as follows: <dtml-if "has(this(),'font_page')"> ... Dieter