summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e0881f)
raw | patch | inline | side by side (parent: 4e0881f)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 29 Jul 2001 04:05:37 +0000 (04:05 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 29 Jul 2001 04:05:37 +0000 (04:05 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@124 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 62f25b77fd18e2b37060d5728a5f3132d8143e3f..4c13318efb13dac271743e2cf371d39f3c1874b6 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
-# $Id: hyperdb.py,v 1.4 2001-07-27 06:25:35 richard Exp $
+# $Id: hyperdb.py,v 1.5 2001-07-29 04:05:37 richard Exp $
# standard python modules
import cPickle, re, string
If an id in a link or multilink property does not refer to a valid
node, an IndexError is raised.
"""
+ if propvalues.has_key('id'):
+ raise KeyError, '"id" is reserved'
+
if self.db.journaltag is None:
raise DatabaseError, 'Database open read-only'
+
+ # new node's id
newid = str(self.count() + 1)
# validate propvalues
IndexError is raised. 'propname' must be the name of a property
of this class or a KeyError is raised.
"""
+ if propname == 'id':
+ return nodeid
# nodeid = str(nodeid)
d = self.db.getnode(self.classname, nodeid)
return d[propname]
"""
if not propvalues:
return
+
+ if propvalues.has_key('id'):
+ raise KeyError, '"id" is reserved'
+
if self.db.journaltag is None:
raise DatabaseError, 'Database open read-only'
+
# nodeid = str(nodeid)
node = self.db.getnode(self.classname, nodeid)
if node.has_key(self.db.RETIRED_FLAG):
def getprops(self):
"""Return a dictionary mapping property names to property objects."""
- return self.properties
+ d = self.properties.copy()
+ d['id'] = String()
+ return d
def addprop(self, **properties):
"""Add properties to this class.
#
# $Log: not supported by cvs2svn $
+# Revision 1.4 2001/07/27 06:25:35 richard
+# Fixed some of the exceptions so they're the right type.
+# Removed the str()-ification of node ids so we don't mask oopsy errors any
+# more.
+#
# Revision 1.3 2001/07/27 05:17:14 richard
# just some comments
#
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 25ebc6390296a953a031a76be89f18f132950501..51cd1dbb0e55f0f8c4af176a80f935c8f48a83e4 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
-# $Id: roundupdb.py,v 1.3 2001-07-23 07:14:41 richard Exp $
+# $Id: roundupdb.py,v 1.4 2001-07-29 04:05:37 richard Exp $
import re, os, smtplib, socket
d['creator'] = hyperdb.Link("user")
return d
- # New methods:
-
+ #
+ # Detector interface
+ #
def audit(self, event, detector):
"""Register a detector
"""
"""
self.reactors[event].append(detector)
+
class FileClass(Class):
def create(self, **propvalues):
''' snaffle the file propvalue and store in a file
#
# $Log: not supported by cvs2svn $
+# Revision 1.3 2001/07/23 07:14:41 richard
+# Moved the database backends off into backends.
+#
# Revision 1.2 2001/07/22 12:09:32 richard
# Final commit of Grande Splite
#