diff options
author | Benjamin Saller <bcsaller@objectrealms.net> | 2007-08-31 05:14:27 (GMT) |
---|---|---|
committer | Benjamin Saller <bcsaller@objectrealms.net> | 2007-08-31 05:14:27 (GMT) |
commit | 48aad0795a4bf8110a7ac48707be3bdc7743597c (patch) | |
tree | 2e1466adca17d38c8b6a042743d84d9fe8c79fca /src/olpc/datastore/datastore.py | |
parent | 57e90f572b41d40f9601c50e2d7e63bc47a6279a (diff) |
wip on tagging
Diffstat (limited to 'src/olpc/datastore/datastore.py')
-rw-r--r-- | src/olpc/datastore/datastore.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/olpc/datastore/datastore.py b/src/olpc/datastore/datastore.py index 0a37f49..d197eda 100644 --- a/src/olpc/datastore/datastore.py +++ b/src/olpc/datastore/datastore.py @@ -317,6 +317,39 @@ class DataStore(dbus.service.Object): return mp.checkout(uid, vid, target=target, dir=dir) @dbus.service.method(DS_DBUS_INTERFACE, + in_signature="sss", + out_signature="" + ) + def tags(self, uid, tags, rev=None): + """ apply tags to a version of a document, there are cases + where some tags apply to all versions of a document and others + where they apply to a specific revision. + + By default tags apply to all revisions but if they end with :0 + then they are demarked as being version specific + + for example + + >>> ds.tags(uid, "foo bar") + + would mark all instances of uid with the tags foo and bar + + while + + >>> ds.tags(uid, "foo bar:0") + + would mark all instances of this uid with "foo" and this + specific instance with "bar". No version changes would be + created to any versions using this call. + + In its current implementation even tags that apply to all + revisions only apply to revision on a particular store. + """ + c = self.get(uid) + c.backingstore.tags(uid, tags) + + + @dbus.service.method(DS_DBUS_INTERFACE, in_signature='ssss', out_signature='a{sv}s') def copy(self, uid, vid=None, mountpoint=None, target_mountpoint=None): |