Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-17 00:03:00 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-17 00:03:00 (GMT)
commit0cda1d5967f9ef41178be44e0751f3babe0d210b (patch)
treec7f5d98f392f6dc690226cd581b54b9d1b6c0756 /src
parentd26583e7d16cc3d91dfd58f8dced8969a5425d64 (diff)
make sure non-model properties make it into the result set
Diffstat (limited to 'src')
-rw-r--r--src/olpc/datastore/xapianindex.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index 49448d7..b104d44 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -235,11 +235,19 @@ class IndexManager(object):
to Property objects
"""
d = {}
+ add_anything = False
for k,v in props.iteritems():
p, added = self.datamodel.fromstring(k, v,
allowAddition=True)
- if added is True: self.fields.add(p.key)
+ if added is True:
+ self.fields.add(p.key)
+ add_anything = True
d[p.key] = p
+
+ if add_anything:
+ with self._write_lock:
+ self.datamodel.apply(self)
+
return d
def index(self, props, filename=None):