From: richard Date: Mon, 19 Aug 2002 00:22:47 +0000 (+0000) Subject: make history() work with new Multilink journal entries X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=73f0e056bd64962f6251e32b6ab3cea292bf187e;p=roundup.git make history() work with new Multilink journal entries git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@965 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/template_funcs.py b/roundup/template_funcs.py index 2087472..65c4f69 100755 --- a/roundup/template_funcs.py +++ b/roundup/template_funcs.py @@ -1,5 +1,5 @@ # -# $Id: template_funcs.py,v 1.2 2002-08-15 00:40:10 richard Exp $ +# $Id: template_funcs.py,v 1.3 2002-08-19 00:22:47 richard Exp $ # import hyperdb, date, password from i18n import _ @@ -618,25 +618,34 @@ def do_history(client, classname, cl, props, nodeid, filterspec, len(args[k]) > 0: ml = [] for linkid in args[k]: - label = classname + linkid - # if we have a label property, try to use it - # TODO: test for node existence even when - # there's no labelprop! - try: - if labelprop is not None: - label = linkcl.get(linkid, labelprop) - except IndexError: - comments['no_link'] = _('''The - linked node no longer - exists''') - ml.append('%s'%label) + if isinstance(linkid, type(())): + sublabel = linkid[0] + ' ' + linkids = linkid[1] else: - if hrefable: - ml.append('%s'%( - classname, linkid, label)) + sublabel = '' + linkids = [linkid] + subml = [] + for linkid in linkids: + label = classname + linkid + # if we have a label property, try to use it + # TODO: test for node existence even when + # there's no labelprop! + try: + if labelprop is not None: + label = linkcl.get(linkid, labelprop) + except IndexError: + comments['no_link'] = _('''The + linked node no longer + exists''') + subml.append('%s'%label) else: - ml.append(label) - cell.append('%s:\n %s'%(k, ',\n '.join(ml))) + if hrefable: + subml.append('%s'%( + classname, linkid, label)) + else: + subml.append(label) + ml.append(sublabel + ', '.join(subml)) + cell.append('%s:\n %s'%(k, ', '.join(ml))) elif isinstance(prop, hyperdb.Link) and args[k]: label = classname + args[k] # if we have a label property, try to use it @@ -809,6 +818,9 @@ def do_remove(client, classname, cl, props, nodeid, filterspec): # # $Log: not supported by cvs2svn $ +# Revision 1.2 2002/08/15 00:40:10 richard +# cleanup +# # # # vim: set filetype=python ts=4 sw=4 et si