index 2a338a0bb7ba250a088606c5c0ab9c454726638c..12ba0e49153b6668eb7b20fd4b36587c190929f8 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
# 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.75 2002-09-10 12:44:42 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
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
raise ValueError, 'Journalling is disabled for this class'
journal = self.db.getjournal(self.classname, nodeid)
if journal:
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:
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]
# get the property (raises KeyErorr if invalid)
prop = self.properties[propname]
return d[propname]
return d[propname]
- # XXX not in spec
+ # not in spec
def getnode(self, nodeid, cache=1):
''' Return a convenience wrapper for the node.
def getnode(self, nodeid, cache=1):
''' Return a convenience wrapper for the node.
cldb.close()
raise KeyError, keyvalue
cldb.close()
raise KeyError, keyvalue
- # XXX: change from spec - allows multiple props to match
+ # change from spec - allows multiple props to match
def find(self, **propspec):
'''Get the ids of nodes in this class which link to the given nodes.
def find(self, **propspec):
'''Get the ids of nodes in this class which link to the given nodes.
d['id'] = String()
d['creation'] = hyperdb.Date()
d['activity'] = hyperdb.Date()
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):
return d
def addprop(self, **properties):
self.db.indexer.add_text((self.classname, nodeid, 'content'), content,
mime_type)
self.db.indexer.add_text((self.classname, nodeid, 'content'), content,
mime_type)
-# XXX deviation from spec - was called ItemClass
+# deviation from spec - was called ItemClass
class IssueClass(Class, roundupdb.IssueClass):
# Overridden methods:
def __init__(self, db, classname, **properties):
class IssueClass(Class, roundupdb.IssueClass):
# Overridden methods:
def __init__(self, db, classname, **properties):