From: Richard J. <ri...@us...> - 2001-11-21 04:04:45
|
Update of /cvsroot/roundup/roundup/roundup In directory usw-pr-cvs1:/tmp/cvs-serv1251/roundup Modified Files: htmltemplate.py hyperdb.py Log Message: *sigh* more missing value handling Index: htmltemplate.py =================================================================== RCS file: /cvsroot/roundup/roundup/roundup/htmltemplate.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** htmltemplate.py 2001/11/21 03:40:54 1.42 --- htmltemplate.py 2001/11/21 04:04:43 1.43 *************** *** 574,578 **** # check for a group heading if group_names: ! this_group = [self.cl.get(nodeid, name) for name in group_names] if this_group != old_group: l = [] --- 574,578 ---- # check for a group heading if group_names: ! this_group = [self.cl.get(nodeid, name, '[no value]') for name in group_names] if this_group != old_group: l = [] *************** *** 594,598 **** l.append(group_cl.get(value, key)) else: ! value = self.cl.get(nodeid, name) if value is None: value = '[empty %s]'%name --- 594,598 ---- l.append(group_cl.get(value, key)) else: ! value = self.cl.get(nodeid, name, '[no value]') if value is None: value = '[empty %s]'%name *************** *** 862,865 **** --- 862,868 ---- # # $Log$ + # Revision 1.43 2001/11/21 04:04:43 richard + # *sigh* more missing value handling + # # Revision 1.42 2001/11/21 03:40:54 richard # more new property handling Index: hyperdb.py =================================================================== RCS file: /cvsroot/roundup/roundup/roundup/hyperdb.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** hyperdb.py 2001/11/21 03:40:54 1.33 --- hyperdb.py 2001/11/21 04:04:43 1.34 *************** *** 681,695 **** for list in group, sort: for dir, prop in list: - # handle the properties that might be "faked" - if not an.has_key(prop): - an[prop] = cl.get(a_id, prop) - av = an[prop] - if not bn.has_key(prop): - bn[prop] = cl.get(b_id, prop) - bv = bn[prop] - # sorting is class-specific propclass = properties[prop] # String and Date values are sorted in the natural way if isinstance(propclass, String): --- 681,706 ---- for list in group, sort: for dir, prop in list: # sorting is class-specific propclass = properties[prop] + # handle the properties that might be "faked" + # also, handle possible missing properties + try: + if not an.has_key(prop): + an[prop] = cl.get(a_id, prop) + av = an[prop] + except KeyError: + # the node doesn't have a value for this property + if isinstance(propclass, Multilink): av = [] + else: av = '' + try: + if not bn.has_key(prop): + bn[prop] = cl.get(b_id, prop) + bv = bn[prop] + except KeyError: + # the node doesn't have a value for this property + if isinstance(propclass, Multilink): bv = [] + else: bv = '' + # String and Date values are sorted in the natural way if isinstance(propclass, String): *************** *** 850,853 **** --- 861,867 ---- # # $Log$ + # Revision 1.34 2001/11/21 04:04:43 richard + # *sigh* more missing value handling + # # Revision 1.33 2001/11/21 03:40:54 richard # more new property handling |