Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-07-20 18:49:26 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-07-20 18:49:26 (GMT)
commitf26b551befa7d27aa6aa1736b8a68775965dd80e (patch)
tree34cef0bc735a0c4469b84dd9d58c34475612c352 /src
parent3924afa8371688129f171e6e1f025eb92028d4e9 (diff)
parent9a44a5bafb391faa57a58efdc0f6d451221c9d45 (diff)
Merge branch 'master' of git+ssh://dev.laptop.org/git/projects/datastore
Diffstat (limited to 'src')
-rw-r--r--src/olpc/datastore/model.py9
-rw-r--r--src/olpc/datastore/xapianindex.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/olpc/datastore/model.py b/src/olpc/datastore/model.py
index 929c376..46f2225 100644
--- a/src/olpc/datastore/model.py
+++ b/src/olpc/datastore/model.py
@@ -202,8 +202,13 @@ class Content(object):
if isinstance(v, list) and len(v) == 1:
v = v[0]
field = self._model.fields.get(k)
- kind = propertyByKind(field[1])
- v = kind.from_xapian(v)
+ if field:
+ kind = propertyByKind(field[1])
+ v = kind.from_xapian(v)
+ else:
+ # do some generic property handling
+ if v: v = str(v)
+ else: v = ''
d[k] = v
return d
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index 46eca98..0be462d 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -343,7 +343,7 @@ class IndexManager(object):
q = query.pop('query', None)
if q:
queries.append(self.parse_query(q))
- if not query:
+ if not query and not queries:
# we emptied it
q = self.read_index.query_all()
else: