Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 40 additions & 23 deletions docs/cookbook/attachments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,22 @@ will vary.

::

{ 'content_type': 'video/quicktime',
{
'content_type': 'video/quicktime',
'link_type': 'local',
'local_path': '/Users/kp/Movies/testing/test_movie_002.mov',
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov',
'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov',
'local_path_windows': 'M:\\macusers\\kp\\Movies\\testing\\test_movie_002.mov',
'local_storage': {
'id': 1,
'name': 'Dailies Directories',
'type': 'LocalStorage',
},
'name': 'my_test_movie.mov',
'local_path': '/Users/kp/Movies/testing/test_movie_002.mov'
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_002.mov'
'local_path_mac': '/Users/kp/Movies/testing/test_movie_002.mov'
'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_002.mov'
'local_storage': {'id': 1,
'name': 'Dailies Directories',
'type': 'LocalStorage'},
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'}
'relative_path': 'testing/test_movie_002.mov',
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov',
}


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

- **relative_path** (:obj:`str`) *read-only*:
The path to the file relative to the ``local_storage`` root.

- **url** (:obj:`str`) *read-only*:
A file URI (``file://``) path provided for convenience pointing to the value in the ``local_path``

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

Returns::

{'id':123,
'sg_uploaded_movie': { 'content_type': None,
'link_type': 'local',
'name': 'my_test_movie.mov',
'local_path': '/Users/kp/Movies/testing/test_movie_001_.mov'
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_001_.mov'
'local_path_mac': '/Users/kp/Movies/testing/test_movie_001_.mov'
'local_path_windows': 'M:\\macusers\kp\Movies\testing\test_movie_001_.mov'
'local_storage': {'id': 1,
'name': 'Dailies Directories',
'type': 'LocalStorage'},
'url': 'file:///Users/kp/Movies/testing/test_movie_001_.mov'},
'type': 'Version'}
{
'id': 123,
'sg_uploaded_movie': {
'content_type': None,
'link_type': 'local',
'local_path': '/Users/kp/Movies/testing/test_movie_001_.mov',
'local_path_linux': '/home/users/macusers/kp/Movies/testing/test_movie_001_.mov',
'local_path_mac': '/Users/kp/Movies/testing/test_movie_001_.mov',
'local_path_windows': 'M:\\macusers\\kp\\Movies\\testing\\test_movie_001_.mov',
'local_storage': {
'id': 1,
'name': 'Dailies Directories',
'type': 'LocalStorage',
},
'relative_path': 'testing/test_movie_001_.mov',
'name': 'my_test_movie.mov',
'url': 'file:///Users/kp/Movies/testing/test_movie_001_.mov',
},
'type': 'Version',
}

.. note::
When viewing results that include file/link fields with local file link values, all of the
Expand Down Expand Up @@ -335,7 +350,8 @@ Returns::
'name': 'Dailies Directories',
'type': 'LocalStorage'
},
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'
'relative_path': 'testing/test_movie_002.mov',
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov',
},
'type': 'Version',
}
Expand Down Expand Up @@ -379,6 +395,7 @@ Returns::
'name': 'Dailies Directories',
'type': 'LocalStorage'
},
'relative_path': 'testing/test_movie_002.mov',
'url': 'file:///Users/kp/Movies/testing/test_movie_002.mov'
},
'type': 'Version',
Expand Down