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 04:28:30 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-13 04:28:30 (GMT)
commita41d2d5ca21115f3b76a789f5874f35dca089a3d (patch)
tree42ddcb1db77c01ecba8815d1f04b56348c44b145 /src/olpc/datastore/model.py
parent32728d52c6099933df7d452003248634c61b07a2 (diff)
repr on content
show a more complex query in the test
Diffstat (limited to 'src/olpc/datastore/model.py')
-rw-r--r--src/olpc/datastore/model.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/olpc/datastore/model.py b/src/olpc/datastore/model.py
index 80522a2..18d409f 100644
--- a/src/olpc/datastore/model.py
+++ b/src/olpc/datastore/model.py
@@ -134,7 +134,11 @@ class Content(object):
self._doc = xapdoc
self._backingstore = backingstore
self._file = None
-
+
+ def __repr__(self):
+ return "<%s %s>" %(self.__class__.__name__,
+ self.properties)
+
def get_property(self, key, default=_marker):
result = self._doc.data.get(key, default)
if result is _marker: raise KeyError(key)
@@ -210,14 +214,6 @@ class Content(object):
def noop(value): return value
-# Xapian doesn't have real binary storage, rather these keys will get
-# indexed it its database. If the key size is too large the indexing
-# will fail
-# there are two solutions -- divert the storage to the backingstore
-# and retain a key reference to recover it (this is the correct
-# solution long term as it participates in versioning) and what I do
-# now which is to insert and remove spaces into the base64 stream
-# every fixed amount of characters
import re
base64hack = re.compile("(\S{212})")
def base64enc(value): return ' '.join(base64hack.split(value.encode('base64')))