Mercurial > p > roundup > code
changeset 1099:7362dc1f0226
Made "creator" property a String like it should be (we can't lookup()
retired users reliably)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 10 Sep 2002 08:04:57 +0000 |
| parents | c5819344714c |
| children | f96deb4fb935 |
| files | roundup/backends/back_anydbm.py roundup/cgi/templating.py roundup/templates/classic/html/issue.item |
| diffstat | 3 files changed, 8 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Tue Sep 10 07:07:16 2002 +0000 +++ b/roundup/backends/back_anydbm.py Tue Sep 10 08:04:57 2002 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.73 2002-09-10 00:11:49 richard Exp $ +#$Id: back_anydbm.py,v 1.74 2002-09-10 08:04:56 richard Exp $ ''' This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python @@ -976,14 +976,9 @@ raise ValueError, 'Journalling is disabled for this class' journal = self.db.getjournal(self.classname, nodeid) if journal: - name = self.db.getjournal(self.classname, nodeid)[0][2] + return self.db.getjournal(self.classname, nodeid)[0][2] else: - return None - try: - return self.db.user.lookup(name) - except KeyError: - # the journaltag user doesn't exist any more - return None + return self.db.journaltag # get the property (raises KeyErorr if invalid) prop = self.properties[propname] @@ -1734,7 +1729,9 @@ d['id'] = String() d['creation'] = hyperdb.Date() d['activity'] = hyperdb.Date() - d['creator'] = hyperdb.Link("user") + # can't be a link to user because the user might have been + # retired since the journal entry was created + d['creator'] = hyperdb.String() return d def addprop(self, **properties):
--- a/roundup/cgi/templating.py Tue Sep 10 07:07:16 2002 +0000 +++ b/roundup/cgi/templating.py Tue Sep 10 08:04:57 2002 +0000 @@ -227,9 +227,6 @@ # we don't exist if item == 'id': return None - if item == 'creator': - # but we will be created by this user... - return HTMLUser(self._client, 'user', self._client.userid) # get the property prop = self._props[item] @@ -768,7 +765,7 @@ def plain(self, escape=0): if self._value is None: - return _('[unselected]') + return '' linkcl = self._db.classes[self._prop.classname] k = linkcl.labelprop(1) value = str(linkcl.get(self._value, k)) @@ -807,21 +804,6 @@ l.append('</select>') return '\n'.join(l) - def download(self, showid=0): - linkname = self._prop.classname - linkcl = self._db.getclass(linkname) - k = linkcl.labelprop(1) - linkvalue = cgi.escape(str(linkcl.get(self._value, k))) - if showid: - label = value - title = ' title="%s"'%linkvalue - # note ... this should be urllib.quote(linkcl.get(value, k)) - else: - label = linkvalue - title = '' - return '<a href="%s%s/%s"%s>%s</a>'%(linkname, self._value, - linkvalue, title, label) - def menu(self, size=None, height=None, showid=0, additional=[], **conditions): value = self._value @@ -864,7 +846,6 @@ l.append('<option %svalue="%s">%s</option>'%(s, optionid, lab)) l.append('</select>') return '\n'.join(l) - # def checklist(self, ...) class MultilinkHTMLProperty(HTMLProperty):
--- a/roundup/templates/classic/html/issue.item Tue Sep 10 07:07:16 2002 +0000 +++ b/roundup/templates/classic/html/issue.item Tue Sep 10 08:04:57 2002 +0000 @@ -62,7 +62,7 @@ </table> <span tal:condition="context/id" tal:content="structure string:Created on -<b>${context/creation}</b> by <b>${context/creator/username}</b>, last +<b>${context/creation}</b> by <b>${context/creator}</b>, last changed <b>${context/activity}</b>.">activity info</span> <tal:block tal:condition="context/id">
