summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c2d8fd)
raw | patch | inline | side by side (parent: 6c2d8fd)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 19 Mar 2004 04:58:52 +0000 (04:58 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 19 Mar 2004 04:58:52 +0000 (04:58 +0000) |
- though I'm not at all confident that migration is handled. I'll try to
test this out though (I'll be doing that with *all* the backends before
0.7 goes out ;)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2158 57a73879-2fb5-44c3-a270-3262357dd7e2
test this out though (I'll be doing that with *all* the backends before
0.7 goes out ;)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2158 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_metakit.py | patch | blob | history |
index ff544738fbf76290784c77ebf71fe138fa5ea1fd..a0efd69db7d06f35c23b4801a1398a33170ac67d 100755 (executable)
-# $Id: back_metakit.py,v 1.63 2004-03-19 04:47:59 richard Exp $
+# $Id: back_metakit.py,v 1.64 2004-03-19 04:58:52 richard Exp $
'''Metakit backend for Roundup, originally by Gordon McMillan.
Known Current Bugs:
privateprops = None
def __init__(self, db, classname, **properties):
if (properties.has_key('creation') or properties.has_key('activity')
- or properties.has_key('creator')):
+ or properties.has_key('creator') or properties.has_key('actor')):
raise ValueError, '"creation", "activity" and "creator" are '\
'reserved'
if hasattr(db, classname):
self.ruprops = properties
self.privateprops = { 'id' : hyperdb.String(),
'activity' : hyperdb.Date(),
+ 'actor' : hyperdb.Link('user'),
'creation' : hyperdb.Date(),
'creator' : hyperdb.Link('user') }
return propvalues
if not propvalues.has_key('activity'):
row.activity = int(time.time())
+ if not propvalues.has_key('actor'):
+ row.actor = int(self.db.getuid())
if isnew:
if not row.creation:
row.creation = int(time.time())
if _typmap[rutyp.__class__] != mkprop.type:
break
else:
-
- return view.ordered(1)
+ # make sure we have the 'actor' property too
+ for mkprop in mkprops:
+ if mkprop.name == 'actor':
+ return view.ordered(1)
+
# The schema has changed. We need to create or restructure the mk view
# id comes first, so we can use view.ordered(1) so that
# MK will order it for us to allow binary-search quick lookups on
s = ["%s[id:I" % self.classname]
# these columns will always be added, we can't trample them :)
- _columns = {"id":"I", "_isdel":"I", "activity":"I", "creation":"I", "creator":"I"}
+ _columns = {"id":"I", "_isdel":"I", "activity":"I", "actor": "I",
+ "creation":"I", "creator":"I"}
for nm, rutyp in self.ruprops.items():
mktyp = _typmap[rutyp.__class__].upper()
# XXX FIX ME -> in some tests, creation:I becomes creation:S is this
# okay? Does this need to be supported?
- s.append('_isdel:I,activity:I,creation:I,creator:I]')
+ s.append('_isdel:I,activity:I,actor:I,creation:I,creator:I]')
view = self.db._db.getas(','.join(s))
self.db.commit()
return view.ordered(1)