diff --git a/synapse/models/files.py b/synapse/models/files.py index 7961cd3158..f9168b5561 100644 --- a/synapse/models/files.py +++ b/synapse/models/files.py @@ -428,10 +428,12 @@ def getModelDefs(self): 'doc': 'The child file contained in the parent file.', }), ('name', ('file:base', {}), { - 'doc': 'The name of the child file. Because a given set of bytes ' - 'can have any number of arbitrary names, this field is ' - 'used for display purposes only.' - }) + 'deprecated': True, + 'doc': 'Deprecated, please use the :path property.', + }), + ('path', ('file:path', {}), { + 'doc': 'The path that the parent uses to refer to the child file.', + }), )), ('file:path', {}, ( diff --git a/synapse/tests/test_model_files.py b/synapse/tests/test_model_files.py index 39c04f99e4..6a3ddffdb0 100644 --- a/synapse/tests/test_model_files.py +++ b/synapse/tests/test_model_files.py @@ -182,11 +182,12 @@ async def test_model_file_types(self): fake = await snap.addNode('file:bytes', '*') self.true(fake.ndef[1].startswith('guid:')) - node = await snap.addNode('file:subfile', (node1.ndef[1], node2.ndef[1]), {'name': 'embed.BIN'}) + node = await snap.addNode('file:subfile', (node1.ndef[1], node2.ndef[1]), {'name': 'embed.BIN', 'path': 'foo/embed.bin'}) self.eq(node.ndef[1], (node1.ndef[1], node2.ndef[1])) self.eq(node.get('parent'), node1.ndef[1]) self.eq(node.get('child'), node2.ndef[1]) self.eq(node.get('name'), 'embed.bin') + self.eq(node.get('path'), 'foo/embed.bin') fp = 'C:\\www\\woah\\really\\sup.exe' node = await snap.addNode('file:filepath', (node0.ndef[1], fp))