Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 452:7181efddce66
yuck, a gdbm instance tests false :(
I've left the debugging code in - it should be removed one day if we're ever
_really_ anal about performace :)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 14 Dec 2001 23:42:57 +0000 |
| parents | a28a80b714f9 |
| children | 6abdddc506e9 |
comparison
equal
deleted
inserted
replaced
| 451:55654ff0028c | 452:7181efddce66 |
|---|---|
| 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.39 2001-12-02 05:06:16 richard Exp $ | 18 # $Id: hyperdb.py,v 1.40 2001-12-14 23:42:57 richard Exp $ |
| 19 | 19 |
| 20 __doc__ = """ | 20 __doc__ = """ |
| 21 Hyperdatabase implementation, especially field types. | 21 Hyperdatabase implementation, especially field types. |
| 22 """ | 22 """ |
| 23 | 23 |
| 99 self.db = weakref.proxy(db) # use a weak ref to avoid circularity | 99 self.db = weakref.proxy(db) # use a weak ref to avoid circularity |
| 100 self.key = '' | 100 self.key = '' |
| 101 | 101 |
| 102 # do the db-related init stuff | 102 # do the db-related init stuff |
| 103 db.addclass(self) | 103 db.addclass(self) |
| 104 | |
| 105 def __repr__(self): | |
| 106 return '<hypderdb.Class "%s">'%self.classname | |
| 104 | 107 |
| 105 # Editing nodes: | 108 # Editing nodes: |
| 106 | 109 |
| 107 def create(self, **propvalues): | 110 def create(self, **propvalues): |
| 108 """Create a new node of this class and return its id. | 111 """Create a new node of this class and return its id. |
| 866 cl.create(name=option[i], order=i) | 869 cl.create(name=option[i], order=i) |
| 867 return hyperdb.Link(name) | 870 return hyperdb.Link(name) |
| 868 | 871 |
| 869 # | 872 # |
| 870 # $Log: not supported by cvs2svn $ | 873 # $Log: not supported by cvs2svn $ |
| 874 # Revision 1.39 2001/12/02 05:06:16 richard | |
| 875 # . We now use weakrefs in the Classes to keep the database reference, so | |
| 876 # the close() method on the database is no longer needed. | |
| 877 # I bumped the minimum python requirement up to 2.1 accordingly. | |
| 878 # . #487480 ] roundup-server | |
| 879 # . #487476 ] INSTALL.txt | |
| 880 # | |
| 881 # I also cleaned up the change message / post-edit stuff in the cgi client. | |
| 882 # There's now a clearly marked "TODO: append the change note" where I believe | |
| 883 # the change note should be added there. The "changes" list will obviously | |
| 884 # have to be modified to be a dict of the changes, or somesuch. | |
| 885 # | |
| 886 # More testing needed. | |
| 887 # | |
| 871 # Revision 1.38 2001/12/01 07:17:50 richard | 888 # Revision 1.38 2001/12/01 07:17:50 richard |
| 872 # . We now have basic transaction support! Information is only written to | 889 # . We now have basic transaction support! Information is only written to |
| 873 # the database when the commit() method is called. Only the anydbm | 890 # the database when the commit() method is called. Only the anydbm |
| 874 # backend is modified in this way - neither of the bsddb backends have been. | 891 # backend is modified in this way - neither of the bsddb backends have been. |
| 875 # The mail, admin and cgi interfaces all use commit (except the admin tool | 892 # The mail, admin and cgi interfaces all use commit (except the admin tool |
