|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: hyperdb.py,v 1.57 2002-02-20 05:23:24 richard Exp $ |
| 18 | +# $Id: hyperdb.py,v 1.58 2002-02-27 03:23:16 richard Exp $ |
19 | 19 |
|
20 | 20 | __doc__ = """ |
21 | 21 | Hyperdatabase implementation, especially field types. |
22 | 22 | """ |
23 | 23 |
|
24 | 24 | # standard python modules |
25 | | -import cPickle, re, string, weakref, os |
| 25 | +import re, string, weakref, os |
26 | 26 |
|
27 | 27 | # roundup modules |
28 | 28 | import date, password |
@@ -490,7 +490,6 @@ class or a KeyError is raised. |
490 | 490 | if node.has_key(self.db.RETIRED_FLAG): |
491 | 491 | raise IndexError |
492 | 492 | num_re = re.compile('^\d+$') |
493 | | - set = {} |
494 | 493 | for key, value in propvalues.items(): |
495 | 494 | # check to make sure we're not duplicating an existing key |
496 | 495 | if key == self.key and node[key] != value: |
@@ -1075,14 +1074,19 @@ def retire(self): |
1075 | 1074 | return self.cl.retire(self.nodeid) |
1076 | 1075 |
|
1077 | 1076 |
|
1078 | | -def Choice(name, *options): |
1079 | | - cl = Class(db, name, name=hyperdb.String(), order=hyperdb.String()) |
| 1077 | +def Choice(name, db, *options): |
| 1078 | + '''Quick helper to create a simple class with choices |
| 1079 | + ''' |
| 1080 | + cl = Class(db, name, name=String(), order=String()) |
1080 | 1081 | for i in range(len(options)): |
1081 | | - cl.create(name=option[i], order=i) |
| 1082 | + cl.create(name=options[i], order=i) |
1082 | 1083 | return hyperdb.Link(name) |
1083 | 1084 |
|
1084 | 1085 | # |
1085 | 1086 | # $Log: not supported by cvs2svn $ |
| 1087 | +# Revision 1.57 2002/02/20 05:23:24 richard |
| 1088 | +# Didn't accomodate new values for new properties |
| 1089 | +# |
1086 | 1090 | # Revision 1.56 2002/02/20 05:05:28 richard |
1087 | 1091 | # . Added simple editing for classes that don't define a templated interface. |
1088 | 1092 | # - access using the admin "class list" interface |
|
0 commit comments