Skip to content

Commit b0df9fe

Browse files
authored
SG-40841 Add information about relative_path field (#420)
* Add information about relative_path field * Update docs/cookbook/attachments.rst * Add missing trailing comma for consistence
1 parent 03811c1 commit b0df9fe

1 file changed

Lines changed: 40 additions & 23 deletions

File tree

docs/cookbook/attachments.rst

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,22 @@ will vary.
124124

125125
::
126126

127-
{ 'content_type': 'video/quicktime',
127+
{
128+
'content_type': 'video/quicktime',
128129
'link_type': 'local',
130+
'local_path': '/Users/kp/Movies/testing/test_movie_002.mov',
131+
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov',
132+
'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov',
133+
'local_path_windows': 'M:\\macusers\\kp\\Movies\\testing\\test_movie_002.mov',
134+
'local_storage': {
135+
'id': 1,
136+
'name': 'Dailies Directories',
137+
'type': 'LocalStorage',
138+
},
129139
'name': 'my_test_movie.mov',
130-
'local_path': '/Users/kp/Movies/testing/test_movie_002.mov'
131-
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov'
132-
'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov'
133-
'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_002.mov'
134-
'local_storage': {'id': 1,
135-
'name': 'Dailies Directories',
136-
'type': 'LocalStorage'},
137-
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'}
140+
'relative_path': 'testing/test_movie_002.mov',
141+
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov',
142+
}
138143

139144

140145
********************
@@ -237,6 +242,9 @@ are available:
237242
- **local_storage** (:obj:`dict`) *read-only*:
238243
A dictionary representing which LocalStorage entity is applied for this local file link.
239244

245+
- **relative_path** (:obj:`str`) *read-only*:
246+
The path to the file relative to the ``local_storage`` root.
247+
240248
- **url** (:obj:`str`) *read-only*:
241249
A file URI (``file://``) path provided for convenience pointing to the value in the ``local_path``
242250

@@ -250,19 +258,26 @@ Reading Local File Fields
250258

251259
Returns::
252260

253-
{'id':123,
254-
'sg_uploaded_movie': { 'content_type': None,
255-
'link_type': 'local',
256-
'name': 'my_test_movie.mov',
257-
'local_path': '/Users/kp/Movies/testing/test_movie_001_.mov'
258-
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_001_.mov'
259-
'local_path_mac': '/Users/kp/Movies/testing/test_movie_001_.mov'
260-
'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_001_.mov'
261-
'local_storage': {'id': 1,
262-
'name': 'Dailies Directories',
263-
'type': 'LocalStorage'},
264-
'url': 'file:///Users/kp/Movies/testing/test_movie_001_.mov'},
265-
'type': 'Version'}
261+
{
262+
'id': 123,
263+
'sg_uploaded_movie': {
264+
'content_type': None,
265+
'link_type': 'local',
266+
'local_path': '/Users/kp/Movies/testing/test_movie_001_.mov',
267+
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_001_.mov',
268+
'local_path_mac': '/Users/kp/Movies/testing/test_movie_001_.mov',
269+
'local_path_windows': 'M:\\macusers\\kp\\Movies\\testing\\test_movie_001_.mov',
270+
'local_storage': {
271+
'id': 1,
272+
'name': 'Dailies Directories',
273+
'type': 'LocalStorage',
274+
},
275+
'relative_path': 'testing/test_movie_001_.mov',
276+
'name': 'my_test_movie.mov',
277+
'url': 'file:///Users/kp/Movies/testing/test_movie_001_.mov',
278+
},
279+
'type': 'Version',
280+
}
266281

267282
.. note::
268283
When viewing results that include file/link fields with local file link values, all of the
@@ -335,7 +350,8 @@ Returns::
335350
'name': 'Dailies Directories',
336351
'type': 'LocalStorage'
337352
},
338-
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'
353+
'relative_path': 'testing/test_movie_002.mov',
354+
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov',
339355
},
340356
'type': 'Version',
341357
}
@@ -379,6 +395,7 @@ Returns::
379395
'name': 'Dailies Directories',
380396
'type': 'LocalStorage'
381397
},
398+
'relative_path': 'testing/test_movie_002.mov',
382399
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'
383400
},
384401
'type': 'Version',

0 commit comments

Comments
 (0)