[Zope-dev] Expand all functionality for Confera

Mark D. Lesh lesh@in.net
Wed, 29 Sep 1999 04:18:22 +0000


Hello! Newbie here, but I wanted to bounce something off of
everyone:

In Confera the ?expand_all=1 addition to the end of the URL
was not working.
I went and did as much research as I could on how Confera
returned its 'branches'
I assumed that Confera was broken since the functionality
seemed to work for other types of trees. Upon further
investigation, I believe I have found the culprit to be in
the TreeTag.py as follows:

def tpValuesIds(self, branches, args,
                simple_type={type(''):0, type(1):0,
type(1.0):0}.has_key,
                ):
    # This should build the ids of subitems which are
    # expandable (non-empty). Leaves should never be
    # in the state - it will screw the colspan counting.
    r=[]
    idattr=args['id']
    try:
        try:
            items=getattr(self, branches)()
        except AttributeError: items=()
        for item in items:
            try:
                if getattr(item, branches)():
                    if hasattr(item, idattr):     #<-- SELF
CHANGED TO ITEM
                        id=getattr(item, idattr)  #<-- SELF
CHANGED TO ITEM
                        if not simple_type(type(id)):
id=id()
                    elif hasattr(item, '_p_oid'):
id=oid(item)
                    else: id=pyid(item)

                    e=tpValuesIds(item, branches, args)
                    if e: id=[id,e]
                    else: id=[id]
                    r.append(id)
            except: pass
    except: pass
    return r



Now can anyone see anything wrong with it. I still have
functionality of all my 
management trees, but don't know what other Zope-based apps
might depend on the broken code. Feedback welcome and
invited. (Also, I am not sure on change submission
protocol.)

	Thanks!
		-- Lesh 



-- 
------------------------------
lesh@in.net