Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/olpc/datastore/model.py
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-13 03:03:19 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-13 03:03:19 (GMT)
commitc5ea9bd1f81baa2c367811ae38ff558d1c3eef0e (patch)
tree589131e550ed2463d7f43cb52c32bd230bc3e5a2 /src/olpc/datastore/model.py
parentb58ff0c10ce8246d8d62a09d0aa6622c059e4d28 (diff)
more passing tests
Diffstat (limited to 'src/olpc/datastore/model.py')
-rw-r--r--src/olpc/datastore/model.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/olpc/datastore/model.py b/src/olpc/datastore/model.py
index 4db2ad2..80522a2 100644
--- a/src/olpc/datastore/model.py
+++ b/src/olpc/datastore/model.py
@@ -85,6 +85,12 @@ class Model(object):
self.fields = {}
self.fieldnames = []
+ def copy(self):
+ m = Model()
+ m.fields = self.fields.copy()
+ m.fieldnames = self.fieldnames[:]
+ return m
+
def addField(self, key, kind, overrides=None):
""" Add a field to the model.
key -- field name
@@ -93,8 +99,7 @@ class Model(object):
arguments supplied by kind
"""
if key in self.fields:
- raise KeyError("""Another source tried to add %s field to
- the model""" % key)
+ raise KeyError("""Another source tried to add %s field to the model""" % key)
impl = propertyByKind(kind)
options = impl.defaults.copy()
@@ -266,7 +271,7 @@ registerPropertyType('date', dateenc, datedec, 'date', {'store' : True,
defaultModel = Model().addFields(
- ('text', 'text'),
+ ('fulltext', 'text'),
# vid is version id
('vid', 'number'),
('checksum', 'string'),