diff options
author | Aleksey Lim <alsroot@sugarlabs.org> | 2012-10-19 13:14:33 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@sugarlabs.org> | 2012-10-19 13:14:33 (GMT) |
commit | 1dc1d7708244f0384fd20c484158a9afb8e8399b (patch) | |
tree | 15a71b5b71f94126898d5204bb14a2387e7b38bf | |
parent | 0c4f6effb832a2eb950f8becbcc2eac4430a40de (diff) |
Polish design, return only requested props from GET command
-rw-r--r-- | active_document/volume.py | 9 | ||||
-rwxr-xr-x | tests/units/volume.py | 4 |
2 files changed, 2 insertions, 11 deletions
diff --git a/active_document/volume.py b/active_document/volume.py index da897b1..047ae63 100644 --- a/active_document/volume.py +++ b/active_document/volume.py @@ -25,9 +25,7 @@ from active_document.index import IndexWriter from active_document.commands import document_command, directory_command from active_document.commands import CommandsProcessor, property_command from active_document.commands import to_int, to_list -from active_document.metadata import BlobProperty, BrowsableProperty -from active_document.metadata import StoredProperty -from active_document.metadata import PropertyMeta +from active_document.metadata import BlobProperty, StoredProperty, PropertyMeta from active_toolkit import coroutine, util, enforce @@ -261,10 +259,7 @@ class VolumeCommands(CommandsProcessor): for prop in reply: metadata[prop].assert_access(env.ACCESS_READ) else: - for prop in metadata.values(): - if isinstance(prop, BrowsableProperty) and \ - prop.permissions & env.ACCESS_READ: - reply.append(prop.name) + reply.append('guid') def _get_props(self, doc, request): result = {} diff --git a/tests/units/volume.py b/tests/units/volume.py index d501430..454e8ca 100755 --- a/tests/units/volume.py +++ b/tests/units/volume.py @@ -222,10 +222,6 @@ class VolumeTest(tests.Test): guid = self.call('POST', document='testdocument', content={'prop': 'value'}) self.assertEqual( - sorted(['ctime', 'prop', 'mtime', 'guid', 'localized_prop']), - sorted(self.call('GET', document='testdocument', guid=guid).keys())) - - self.assertEqual( ['guid', 'prop'], self.call('GET', document='testdocument', guid=guid, reply=['guid', 'prop']).keys()) |