summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f72a3c)
raw | patch | inline | side by side (parent: 0f72a3c)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 30 Jul 2001 02:38:31 +0000 (02:38 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 30 Jul 2001 02:38:31 +0000 (02:38 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@162 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/hyperdb.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py
index 252194c0c93636a041f3a316d733841848c0f9a8..ea37bddd6b1ef2d75512753678384e53265bec6c 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
-# $Id: hyperdb.py,v 1.9 2001-07-29 09:28:23 richard Exp $
+# $Id: hyperdb.py,v 1.10 2001-07-30 02:38:31 richard Exp $
# standard python modules
import cPickle, re, string
RETIRED_FLAG = '__hyperdb_retired'
+_marker = []
#
# The base Class class
#
self.db.addjournal(self.classname, newid, 'create', propvalues)
return newid
- def get(self, nodeid, propname):
+ def get(self, nodeid, propname, default=_marker):
"""Get the value of a property on an existing node of this class.
'nodeid' must be the id of an existing node of this class or an
return nodeid
# nodeid = str(nodeid)
d = self.db.getnode(self.classname, nodeid)
+ if not d.has_key(propname) and default is not _marker:
+ return default
return d[propname]
# XXX not in spec
#
# $Log: not supported by cvs2svn $
+# Revision 1.9 2001/07/29 09:28:23 richard
+# Fixed sorting by clicking on column headings.
+#
# Revision 1.8 2001/07/29 08:27:40 richard
# Fixed handling of passed-in values in form elements (ie. during a
# drill-down)
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index cd9fa0e4b96acebe428ab3f26783455daab1c6e8..5b33f30f0154c8681cd65e2bcf9b128983d08523 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
-# $Id: roundupdb.py,v 1.6 2001-07-30 00:05:54 richard Exp $
+# $Id: roundupdb.py,v 1.7 2001-07-30 02:38:31 richard Exp $
import re, os, smtplib, socket
return self.user.create(username=address, address=address,
realname=realname)
+_marker = []
# XXX: added the 'creator' faked attribute
class Class(hyperdb.Class):
# Overridden methods:
for react in self.reactors['retire']:
react(self.db, self, nodeid, None)
- def get(self, nodeid, propname):
+ def get(self, nodeid, propname, default=_marker):
"""Attempts to get the "creation" or "activity" properties should
- do the right thing
+ do the right thing.
"""
if propname == 'creation':
journal = self.db.getjournal(self.classname, nodeid)
else:
return None
return self.db.user.lookup(name)
- return hyperdb.Class.get(self, nodeid, propname)
+ if default is not _marker:
+ return hyperdb.Class.get(self, nodeid, propname, default)
+ else:
+ return hyperdb.Class.get(self, nodeid, propname)
def getprops(self):
"""In addition to the actual properties on the node, these
'''
return open(self.filename(classname, nodeid), 'rb').read()
- def get(self, nodeid, propname):
+ def get(self, nodeid, propname, default=_marker):
''' trap the content propname and get it from the file
'''
if propname == 'content':
return self.getcontent(self.classname, nodeid)
- return Class.get(self, nodeid, propname)
+ if default is not _marker:
+ return Class.get(self, nodeid, propname, default)
+ else:
+ return Class.get(self, nodeid, propname)
def getprops(self):
''' In addition to the actual properties on the node, these methods
#
# $Log: not supported by cvs2svn $
+# Revision 1.6 2001/07/30 00:05:54 richard
+# Fixed IssueClass so that superseders links to its classname rather than
+# hard-coded to "issue".
+#
# Revision 1.5 2001/07/29 07:01:39 richard
# Added vim command to all source so that we don't get no steenkin' tabs :)
#