From: richard Date: Mon, 14 Jan 2002 22:21:38 +0000 (+0000) Subject: #503353 ] setting properties in initial email X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=445a260de1889a4c1edacf52f5f99da49d4aa182;p=roundup.git #503353 ] setting properties in initial email git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@546 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index e4b438d..69224c3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -23,6 +23,7 @@ Fixed: . plain rendering of links in the htmltemplate now generate a hyperlink to the linked node's page. . #503330 ] ANONYMOUS_REGISTER now applies to mail + . #503353 ] setting properties in initial email 2002-01-08 - 0.4.0b1 diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index 851b571..0238be6 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.39 2002-01-14 02:20:15 richard Exp $ +# $Id: roundupdb.py,v 1.40 2002-01-14 22:21:38 richard Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -452,6 +452,38 @@ class IssueClass(Class): line = '_' * max(len(web), len(email)) return '%s\n%s\n%s\n%s'%(line, email, web, line) + def generateCreateNote(self, nodeid): + """Generate a create note that lists initial property values + """ + cn = self.classname + cl = self.db.classes[cn] + props = cl.getprops(protected=0) + + # list the values + m = [] + for propname, prop in props.items(): + value = cl.get(nodeid, propname, None) + if isinstance(prop, hyperdb.Link): + link = self.db.classes[prop.classname] + if value: + key = link.labelprop(default_to_id=1) + if key: + value = link.get(value, key) + else: + value = '' + elif isinstance(prop, hyperdb.Multilink): + if value is None: value = [] + l = [] + link = self.db.classes[prop.classname] + key = link.labelprop(default_to_id=1) + if key: + value = [link.get(entry, key) for entry in value] + value = ', '.join(value) + m.append('%s: %s'%(propname, value)) + m.insert(0, '----------') + m.insert(0, '') + return '\n'.join(m) + def generateChangeNote(self, nodeid, oldvalues): """Generate a change note that lists property changes """ @@ -529,6 +561,15 @@ class IssueClass(Class): # # $Log: not supported by cvs2svn $ +# Revision 1.39 2002/01/14 02:20:15 richard +# . changed all config accesses so they access either the instance or the +# config attriubute on the db. This means that all config is obtained from +# instance_config instead of the mish-mash of classes. This will make +# switching to a ConfigParser setup easier too, I hope. +# +# At a minimum, this makes migration a _little_ easier (a lot easier in the +# 0.5.0 switch, I hope!) +# # Revision 1.38 2002/01/10 05:57:45 richard # namespace clobberation # diff --git a/roundup/templates/classic/detectors/nosyreaction.py b/roundup/templates/classic/detectors/nosyreaction.py index 46099e2..c5c818e 100644 --- a/roundup/templates/classic/detectors/nosyreaction.py +++ b/roundup/templates/classic/detectors/nosyreaction.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: nosyreaction.py,v 1.10 2002-01-11 23:22:29 richard Exp $ +#$Id: nosyreaction.py,v 1.11 2002-01-14 22:21:38 richard Exp $ from roundup import roundupdb @@ -39,6 +39,7 @@ def nosyreaction(db, cl, nodeid, oldvalues): if oldvalues is None: # the action was a create, so use all the messages in the create messages = cl.get(nodeid, 'messages') + change_note = cl.generateCreateNote(nodeid) elif oldvalues.has_key('messages'): # the action was a set (so adding new messages to an existing issue) m = {} @@ -67,6 +68,14 @@ def init(db): # #$Log: not supported by cvs2svn $ +#Revision 1.10 2002/01/11 23:22:29 richard +# . #502437 ] rogue reactor and unittest +# in short, the nosy reactor was modifying the nosy list. That code had +# been there for a long time, and I suspsect it was there because we +# weren't generating the nosy list correctly in other places of the code. +# We're now doing that, so the nosy-modifying code can go away from the +# nosy reactor. +# #Revision 1.9 2001/12/15 19:24:39 rochecompaan # . Modified cgi interface to change properties only once all changes are # collected, files created and messages generated. diff --git a/roundup/templates/extended/detectors/nosyreaction.py b/roundup/templates/extended/detectors/nosyreaction.py index d148b41..b303043 100644 --- a/roundup/templates/extended/detectors/nosyreaction.py +++ b/roundup/templates/extended/detectors/nosyreaction.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: nosyreaction.py,v 1.10 2002-01-11 23:22:29 richard Exp $ +#$Id: nosyreaction.py,v 1.11 2002-01-14 22:21:38 richard Exp $ from roundup import roundupdb @@ -39,6 +39,7 @@ def nosyreaction(db, cl, nodeid, oldvalues): if oldvalues is None: # the action was a create, so use all the messages in the create messages = cl.get(nodeid, 'messages') + change_note = cl.generateCreateNote(nodeid) elif oldvalues.has_key('messages'): # the action was a set (so adding new messages to an existing issue) m = {} @@ -68,6 +69,14 @@ def init(db): # #$Log: not supported by cvs2svn $ +#Revision 1.10 2002/01/11 23:22:29 richard +# . #502437 ] rogue reactor and unittest +# in short, the nosy reactor was modifying the nosy list. That code had +# been there for a long time, and I suspsect it was there because we +# weren't generating the nosy list correctly in other places of the code. +# We're now doing that, so the nosy-modifying code can go away from the +# nosy reactor. +# #Revision 1.9 2001/12/15 19:24:39 rochecompaan # . Modified cgi interface to change properties only once all changes are # collected, files created and messages generated.