Michel Pelletier wrote: >On Mon, 10 Sep 2001 12:16:51 -0400 > Jim Washington <[EMAIL PROTECTED]> wrote: > >>Hi, All >> >>Since the Collector is down, where do we send patches if we are not >>cvs-authorized? I just discovered a not-too-clever hack to make the >>Find tab recurse through methods of Z Classes, which the margin of >>this >>e-mail is too small to contain. >> > >Dude, don't jinx yourself. I'm sure you don't want us to refer to this as Jim >Washington's last patch. ;) > Ack! I deserve that for playing the cleverness card. Fortunately, I am not planning any duels anytime soon :) The requested change does seem to work, and does not seem to break anything. And it is probably bad to admit that Z Classes are somehow different enough to require special treatment in base Zope code. FWIW, my patch (against FindSupport.py in 2.4.1) is attached. Consume at your leisure. -- Jim Washington
*** FindSupport.py.orig Mon Sep 10 11:31:20 2001 --- FindSupport.py Mon Sep 10 11:55:19 2001 *************** *** 152,168 **** if hasattr(obj, 'aq_base'): base=obj.aq_base ! if not hasattr(base, 'objectItems'): return result try: items=obj.objectItems() except: return result try: add_result=result.append except: raise AttributeError, `result` for id, ob in items: ! if pre: p="%s/%s" % (pre, id) else: p=id dflag=0 --- 152,179 ---- if hasattr(obj, 'aq_base'): base=obj.aq_base ! if not hasattr(base, 'objectItems') and not base.meta_type == 'Z Class': return result + + if hasattr(base, 'objectItems'): try: items=obj.objectItems() except: return result + if base.meta_type == 'Z Class': + try: items=obj.propertysheets.methods.objectItems() + except: return result + + try: add_result=result.append except: raise AttributeError, `result` for id, ob in items: ! if pre: ! if base.meta_type == 'Z Class': ! p = "%s/propertysheets/methods/%s" % (pre,id) ! else: ! p="%s/%s" % (pre, id) else: p=id dflag=0 *************** *** 194,201 **** ): add_result((p, ob)) dflag=0 ! ! if search_sub and hasattr(bs, 'objectItems'): self.ZopeFind(ob, obj_ids, obj_metatypes, obj_searchterm, obj_expr, obj_mtime, obj_mspec, --- 204,211 ---- ): add_result((p, ob)) dflag=0 ! #small edit here to add the or ! if search_sub and (hasattr(bs, 'objectItems') or bs.meta_type == 'Z Class'): self.ZopeFind(ob, obj_ids, obj_metatypes, obj_searchterm, obj_expr, obj_mtime, obj_mspec,