summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 824c57a)
raw | patch | inline | side by side (parent: 824c57a)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Jul 2001 07:14:41 +0000 (07:14 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Jul 2001 07:14:41 +0000 (07:14 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@48 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/__init__.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history | |
roundup/templates/extended/dbinit.py | patch | blob | history |
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4bffc9409814d62db6ed831b7f06e263442208f3 100644 (file)
+import _bsddb; bsddb = _bsddb
+import _anydbm; anydbm = _anydbm
+
+__all__ = ['bsddb', 'anydbm']
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 57023bcefe2bb8ea2b22712dcc09f6eed9c95d99..25ebc6390296a953a031a76be89f18f132950501 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
-# $Id: roundupdb.py,v 1.2 2001-07-22 12:09:32 richard Exp $
+# $Id: roundupdb.py,v 1.3 2001-07-23 07:14:41 richard Exp $
import re, os, smtplib, socket
return self.user.create(username=address, address=address,
realname=realname)
+# XXX: added the 'creator' faked attribute
class Class(hyperdb.Class):
# Overridden methods:
def __init__(self, db, classname, **properties):
for react in self.reactors['retire']:
react(self.db, self, nodeid, None)
+ def get(self, nodeid, propname):
+ """Attempts to get the "creation" or "activity" properties should
+ do the right thing
+ """
+ if propname == 'creation':
+ journal = self.db.getjournal(self.classname, nodeid)
+ if journal:
+ return self.db.getjournal(self.classname, nodeid)[0][1]
+ else:
+ # on the strange chance that there's no journal
+ return date.Date()
+ if propname == 'activity':
+ journal = self.db.getjournal(self.classname, nodeid)
+ if journal:
+ return self.db.getjournal(self.classname, nodeid)[-1][1]
+ else:
+ # on the strange chance that there's no journal
+ return date.Date()
+ if propname == 'creator':
+ journal = self.db.getjournal(self.classname, nodeid)
+ if journal:
+ name = self.db.getjournal(self.classname, nodeid)[0][2]
+ else:
+ return None
+ return self.db.user.lookup(name)
+ return hyperdb.Class.get(self, nodeid, propname)
+
+ def getprops(self):
+ """In addition to the actual properties on the node, these
+ methods provide the "creation" and "activity" properties."""
+ d = hyperdb.Class.getprops(self).copy()
+ d['creation'] = hyperdb.Date()
+ d['activity'] = hyperdb.Date()
+ d['creator'] = hyperdb.Link("user")
+ return d
+
# New methods:
def audit(self, event, detector):
raise ValueError, '"creation", "activity" and "creator" are reserved'
Class.__init__(self, db, classname, **properties)
- def get(self, nodeid, propname):
- if propname == 'creation':
- return self.db.getjournal(self.classname, nodeid)[0][1]
- if propname == 'activity':
- return self.db.getjournal(self.classname, nodeid)[-1][1]
- if propname == 'creator':
- name = self.db.getjournal(self.classname, nodeid)[0][2]
- return self.db.user.lookup(name)
- return Class.get(self, nodeid, propname)
-
- def getprops(self):
- """In addition to the actual properties on the node, these
- methods provide the "creation" and "activity" properties."""
- d = Class.getprops(self).copy()
- d['creation'] = hyperdb.Date()
- d['activity'] = hyperdb.Date()
- d['creator'] = hyperdb.Link("user")
- return d
-
# New methods:
def addmessage(self, nodeid, summary, text):
#
# $Log: not supported by cvs2svn $
+# Revision 1.2 2001/07/22 12:09:32 richard
+# Final commit of Grande Splite
+#
# Revision 1.1 2001/07/22 11:58:35 richard
# More Grande Splite
#
index 8a526e05ead8e19cd0d5ae9225a4f5254a559367..3684693b840ce3cc08e27bdebfbbddc4033cc8c5 100644 (file)
-# $Id: dbinit.py,v 1.2 2001-07-23 06:25:50 richard Exp $
+# $Id: dbinit.py,v 1.3 2001-07-23 07:14:41 richard Exp $
-import instance_config
-from roundup import hyperdb, backends.bsddb, roundupdb, cgi_client, mailgw
-
-from roundup.roundupdb import Class, FileClass
import os
+import instance_config
+from roundup import roundupdb, cgi_client, mailgw
+from roundup.backends import bsddb
+from roundup.roundupdb import Class, FileClass
-class Database(roundupdb.Database, backends.bsddb.Database):
+class Database(roundupdb.Database, bsddb.Database):
''' Creates a hybrid database from:
- . the base Database class given in hyperdb (basic functionlity)
- . the BSDDB implementation in hyperdb_bsddb
+ . the BSDDB implementation in backends.bsddb
. the roundup extensions from roundupdb
'''
pass
#
# $Log: not supported by cvs2svn $
+# Revision 1.2 2001/07/23 06:25:50 richard
+# relfected the move to roundup/backends
+#
# Revision 1.1 2001/07/23 04:33:21 anthonybaxter
# split __init__.py into 2. dbinit and instance_config.
#