@@ -238,7 +238,7 @@ are available:
238238 A dictionary representing which LocalStorage entity is applied for this local file link.
239239
240240- **url ** (:obj: `str `) *read-only *:
241- A file:// link provided for convenience pointing to the value in the ``local_path ``
241+ A file URI (`` file ://``) path provided for convenience pointing to the value in the ``local_path ``
242242
243243Reading Local File Fields
244244=========================
@@ -284,40 +284,107 @@ defaults. Any other keys that are provided will be ignored.
284284 Optionally set the mime-type of the associated local file. This is assigned automatically
285285 using a best-guess based on the file extension.
286286
287-
288287* **name ** :obj: `str `:
289288 Optional display name of the local file. This is set to the filename by default.
290289
291290* **local_path ** :obj: `str `:
292- The full local path to the file. Flow Production Tracking will find the LocalStorage
291+ The full local path to the file. Flow Production Tracking will find the `` LocalStorage ``
293292 that has the most specific match to this path and automatically assign that LocalStorage to
294293 the file.
294+ Alternative to ``relative_path ``
295+
296+ * **local_storage ** :obj: `dict `:
297+ The reference to an existing ``LocalStorage ``.
298+ Must contain ``type: LocalStorage `` plus either an ``id `` or a ``name ``
299+
300+ * **relative_path ** :obj: `str `:
301+ The path to the file relative ``local_storage `` root.
302+ Requires ``local_storage ``
303+ Only accepting slash ``/ `` separated path. Does not accept Windows path.
304+ Alternative to ``local_path ``
305+
306+ Example 1: Using ``local_path ``
307+ ------------------------------
295308
296309::
297310
298- data = {'sg_uploaded_movie': {'local_path': '/Users/kp/Movies/testing/test_movie_002.mov',
299- 'name': 'Better Movie'}
300- result = sg.update('Version', 123, data)
311+ result = sg.update(
312+ 'Version',
313+ 123,
314+ {
315+ 'sg_uploaded_movie': {
316+ 'local_path': '/Users/kp/Movies/testing/test_movie_002.mov',
317+ 'name': 'Better Movie',
318+ }
319+ )
301320
302321Returns::
303322
304- {'id':123,
305- 'sg_uploaded_movie': { 'content_type': 'video/quicktime',
306- 'link_type': 'local',
307- 'name': 'my_test_movie.mov',
308- 'local_path': '/Users/kp/Movies/testing/test_movie_002.mov'
309- 'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov'
310- 'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov'
311- 'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_002.mov'
312- 'local_storage': {'id': 1,
313- 'name': 'Dailies Directories',
314- 'type': 'LocalStorage'},
315- 'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'},
316- 'type': 'Version'}]
323+ {
324+ 'id':123,
325+ 'sg_uploaded_movie': {
326+ 'content_type': 'video/quicktime',
327+ 'link_type': 'local',
328+ 'name': 'my_test_movie.mov',
329+ 'local_path': '/Users/kp/Movies/testing/test_movie_002.mov'
330+ 'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov'
331+ 'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov'
332+ 'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_002.mov'
333+ 'local_storage': {
334+ 'id': 1,
335+ 'name': 'Dailies Directories',
336+ 'type': 'LocalStorage'
337+ },
338+ 'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'
339+ },
340+ 'type': 'Version',
341+ }
317342
318343The ``content_type `` was assigned a best-guess value based on the file extension. Flow Production Tracking selected
319344the most appropriate specific LocalStorage match and assigned it to local_storage automatically.
320345
346+
347+ Example 2: Using ``relative_path ``
348+ ---------------------------------
349+
350+ ::
351+
352+ result = sg.update(
353+ 'Version',
354+ 123,
355+ {
356+ 'sg_uploaded_movie': {
357+ 'local_storage': {
358+ 'type': 'LocalStorage',
359+ 'name': 'Dailies Directories',
360+ },
361+ 'relative_path': 'testing/test_movie_002.mov',
362+ }
363+ )
364+
365+ Returns::
366+
367+ {
368+ 'id':123,
369+ 'sg_uploaded_movie': {
370+ 'content_type': 'video/quicktime',
371+ 'link_type': 'local',
372+ 'name': 'my_test_movie.mov',
373+ 'local_path': '/Users/kp/Movies/testing/test_movie_002.mov',
374+ 'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov',
375+ 'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov',
376+ 'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_002.mov',
377+ 'local_storage': {
378+ 'id': 1,
379+ 'name': 'Dailies Directories',
380+ 'type': 'LocalStorage'
381+ },
382+ 'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'
383+ },
384+ 'type': 'Version',
385+ }
386+
387+
321388Un-setting local file field values
322389==================================
323390
0 commit comments