comparison roundup/hyperdb.py @ 993:07f88a837450

turn on journalling of links by default
author Richard Jones <richard@users.sourceforge.net>
date Fri, 30 Aug 2002 08:37:16 +0000
parents 301a02ea6020
children 04a6b3bfbf23
comparison
equal deleted inserted replaced
992:6003d6fa02a5 993:07f88a837450
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: hyperdb.py,v 1.80 2002-08-16 04:28:13 richard Exp $ 18 # $Id: hyperdb.py,v 1.81 2002-08-30 08:37:16 richard Exp $
19 19
20 __doc__ = """ 20 __doc__ = """
21 Hyperdatabase implementation, especially field types. 21 Hyperdatabase implementation, especially field types.
22 """ 22 """
23 23
81 return '<%s>'%self.__class__ 81 return '<%s>'%self.__class__
82 82
83 class Link: 83 class Link:
84 """An object designating a Link property that links to a 84 """An object designating a Link property that links to a
85 node in a specified class.""" 85 node in a specified class."""
86 def __init__(self, classname, do_journal='no'): 86 def __init__(self, classname, do_journal='yes'):
87 ''' Default is to not journal link and unlink events 87 ''' Default is to not journal link and unlink events
88 ''' 88 '''
89 self.classname = classname 89 self.classname = classname
90 self.do_journal = do_journal == 'yes' 90 self.do_journal = do_journal == 'yes'
91 def __repr__(self): 91 def __repr__(self):
99 "classname" indicates the class to link to 99 "classname" indicates the class to link to
100 100
101 "do_journal" indicates whether the linked-to nodes should have 101 "do_journal" indicates whether the linked-to nodes should have
102 'link' and 'unlink' events placed in their journal 102 'link' and 'unlink' events placed in their journal
103 """ 103 """
104 def __init__(self, classname, do_journal='no'): 104 def __init__(self, classname, do_journal='yes'):
105 ''' Default is to not journal link and unlink events 105 ''' Default is to not journal link and unlink events
106 ''' 106 '''
107 self.classname = classname 107 self.classname = classname
108 self.do_journal = do_journal == 'yes' 108 self.do_journal = do_journal == 'yes'
109 def __repr__(self): 109 def __repr__(self):
332 raise NotImplementedError 332 raise NotImplementedError
333 333
334 def __repr__(self): 334 def __repr__(self):
335 '''Slightly more useful representation 335 '''Slightly more useful representation
336 ''' 336 '''
337 return '<hypderdb.Class "%s">'%self.classname 337 return '<hyperdb.Class "%s">'%self.classname
338 338
339 # Editing nodes: 339 # Editing nodes:
340 340
341 def create(self, **propvalues): 341 def create(self, **propvalues):
342 """Create a new node of this class and return its id. 342 """Create a new node of this class and return its id.
607 cl.create(name=options[i], order=i) 607 cl.create(name=options[i], order=i)
608 return hyperdb.Link(name) 608 return hyperdb.Link(name)
609 609
610 # 610 #
611 # $Log: not supported by cvs2svn $ 611 # $Log: not supported by cvs2svn $
612 # Revision 1.80 2002/08/16 04:28:13 richard
613 # added is_retired query to Class
614 #
612 # Revision 1.79 2002/07/29 23:30:14 richard 615 # Revision 1.79 2002/07/29 23:30:14 richard
613 # documentation reorg post-new-security 616 # documentation reorg post-new-security
614 # 617 #
615 # Revision 1.78 2002/07/21 03:26:37 richard 618 # Revision 1.78 2002/07/21 03:26:37 richard
616 # Gordon, does this help? 619 # Gordon, does this help?

Roundup Issue Tracker: http://roundup-tracker.org/