From 48aad0795a4bf8110a7ac48707be3bdc7743597c Mon Sep 17 00:00:00 2001 From: Benjamin Saller Date: Fri, 31 Aug 2007 05:14:27 +0000 Subject: wip on tagging --- (limited to 'src/olpc/datastore/model.py') diff --git a/src/olpc/datastore/model.py b/src/olpc/datastore/model.py index 1e13a13..f17e842 100644 --- a/src/olpc/datastore/model.py +++ b/src/olpc/datastore/model.py @@ -349,6 +349,10 @@ registerPropertyType('text', noop, noop, 'string', {'store' : True, 'collapse' : True, }) +registerPropertyType('tag', noop, str.lower, 'string', {'store' : True, + 'exact' : True, + }) + # Now the convention is to directly use DBus.ByteArray registerPropertyType('binary', str, dbus.ByteArray, None, {'store' : True, 'exact' : False, @@ -397,9 +401,10 @@ defaultModel = Model().addFields( ('ctime', 'date'), ('mtime', 'date'), # this will just be a space delimited list of tags - # indexed with the content - # I give them high weight as they have user given semantic value. - ('tags', 'text', {'weight' :3 } ), + # tags are case-insensitive and managed via the tags() API call + # while they can be set as normal properties with checkin that + # will create new versions and the tags() call will not. + ('tags', 'tag'), # olpc specific ('activity', 'string'), -- cgit v0.9.1