zou 0.20.83__py3-none-any.whl → 0.20.84__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zou/__init__.py +1 -1
- zou/app/blueprints/comments/resources.py +32 -35
- zou/app/blueprints/concepts/resources.py +23 -8
- zou/app/blueprints/crud/asset_instance.py +272 -0
- zou/app/blueprints/crud/attachment_file.py +263 -0
- zou/app/blueprints/crud/base.py +176 -69
- zou/app/blueprints/crud/budget.py +278 -0
- zou/app/blueprints/crud/budget_entry.py +269 -0
- zou/app/blueprints/crud/chat.py +282 -0
- zou/app/blueprints/crud/chat_message.py +286 -0
- zou/app/blueprints/crud/comments.py +312 -1
- zou/app/blueprints/crud/custom_action.py +268 -0
- zou/app/blueprints/crud/day_off.py +298 -0
- zou/app/blueprints/crud/department.py +268 -0
- zou/app/blueprints/crud/entity.py +297 -3
- zou/app/blueprints/crud/entity_link.py +303 -0
- zou/app/blueprints/crud/entity_type.py +269 -0
- zou/app/blueprints/crud/event.py +197 -0
- zou/app/blueprints/crud/file_status.py +268 -0
- zou/app/blueprints/crud/hardware_item.py +268 -0
- zou/app/blueprints/crud/metadata_descriptor.py +312 -0
- zou/app/blueprints/crud/milestone.py +302 -1
- zou/app/blueprints/crud/news.py +285 -0
- zou/app/blueprints/crud/notification.py +287 -0
- zou/app/blueprints/crud/organisation.py +269 -0
- zou/app/blueprints/crud/output_file.py +34 -10
- zou/app/blueprints/crud/output_type.py +30 -10
- zou/app/blueprints/crud/person.py +407 -2
- zou/app/blueprints/crud/playlist.py +322 -4
- zou/app/blueprints/crud/plugin.py +269 -0
- zou/app/blueprints/crud/preview_background_file.py +272 -0
- zou/app/blueprints/crud/preview_file.py +280 -9
- zou/app/blueprints/crud/production_schedule_version.py +569 -0
- zou/app/blueprints/crud/project.py +440 -0
- zou/app/blueprints/crud/project_status.py +268 -0
- zou/app/blueprints/crud/salary_scale.py +185 -5
- zou/app/blueprints/crud/schedule_item.py +305 -0
- zou/app/blueprints/crud/search_filter.py +302 -0
- zou/app/blueprints/crud/search_filter_group.py +270 -0
- zou/app/blueprints/crud/software.py +30 -10
- zou/app/blueprints/crud/status_automation.py +296 -2
- zou/app/blueprints/crud/studio.py +268 -0
- zou/app/blueprints/crud/subscription.py +279 -0
- zou/app/blueprints/crud/task.py +325 -5
- zou/app/blueprints/crud/task_status.py +301 -0
- zou/app/blueprints/crud/task_type.py +283 -0
- zou/app/blueprints/crud/time_spent.py +327 -0
- zou/app/blueprints/crud/working_file.py +273 -10
- zou/app/blueprints/export/csv/assets.py +15 -5
- zou/app/blueprints/export/csv/base.py +12 -3
- zou/app/blueprints/export/csv/casting.py +32 -5
- zou/app/blueprints/export/csv/edits.py +15 -5
- zou/app/blueprints/export/csv/persons.py +24 -0
- zou/app/blueprints/export/csv/playlists.py +16 -5
- zou/app/blueprints/export/csv/projects.py +23 -0
- zou/app/blueprints/export/csv/shots.py +15 -5
- zou/app/blueprints/export/csv/task_types.py +23 -0
- zou/app/blueprints/export/csv/tasks.py +24 -0
- zou/app/blueprints/export/csv/time_spents.py +24 -0
- zou/app/blueprints/files/resources.py +928 -377
- zou/app/blueprints/news/resources.py +7 -5
- zou/app/blueprints/persons/resources.py +644 -271
- zou/app/blueprints/playlists/resources.py +154 -72
- zou/app/blueprints/previews/resources.py +473 -228
- zou/app/blueprints/projects/__init__.py +5 -0
- zou/app/blueprints/projects/resources.py +987 -420
- zou/app/blueprints/search/resources.py +44 -32
- zou/app/blueprints/shots/resources.py +1338 -88
- zou/app/blueprints/source/csv/assets.py +44 -6
- zou/app/blueprints/source/csv/casting.py +43 -6
- zou/app/blueprints/source/csv/edits.py +47 -9
- zou/app/blueprints/source/csv/persons.py +43 -4
- zou/app/blueprints/source/csv/shots.py +47 -6
- zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
- zou/app/blueprints/source/kitsu.py +433 -11
- zou/app/blueprints/source/otio.py +215 -20
- zou/app/blueprints/source/shotgun/assets.py +146 -0
- zou/app/blueprints/source/shotgun/base.py +85 -14
- zou/app/blueprints/source/shotgun/episode.py +124 -0
- zou/app/blueprints/source/shotgun/import_errors.py +105 -14
- zou/app/blueprints/source/shotgun/notes.py +132 -0
- zou/app/blueprints/source/shotgun/person.py +163 -0
- zou/app/blueprints/source/shotgun/project.py +120 -0
- zou/app/blueprints/source/shotgun/scene.py +120 -0
- zou/app/blueprints/source/shotgun/sequence.py +134 -0
- zou/app/blueprints/source/shotgun/shot.py +166 -0
- zou/app/blueprints/source/shotgun/status.py +129 -0
- zou/app/blueprints/source/shotgun/steps.py +138 -0
- zou/app/blueprints/source/shotgun/tasks.py +199 -0
- zou/app/blueprints/source/shotgun/team.py +132 -0
- zou/app/blueprints/source/shotgun/versions.py +155 -0
- zou/app/blueprints/tasks/resources.py +1197 -308
- zou/app/models/metadata_descriptor.py +1 -0
- zou/app/services/persons_service.py +1 -1
- zou/app/services/projects_service.py +45 -1
- zou/app/services/time_spents_service.py +1 -1
- zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
- {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
- {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/RECORD +103 -102
- {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
- {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
- {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.preview_background_file import PreviewBackgroundFile
|
|
2
4
|
from zou.app.services.exception import WrongParameterException
|
|
3
5
|
from zou.app.services import files_service, deletion_service
|
|
@@ -12,6 +14,133 @@ class PreviewBackgroundFilesResource(BaseModelsResource):
|
|
|
12
14
|
def check_read_permissions(self, options=None):
|
|
13
15
|
return True
|
|
14
16
|
|
|
17
|
+
@jwt_required()
|
|
18
|
+
def get(self):
|
|
19
|
+
"""
|
|
20
|
+
Get preview background files
|
|
21
|
+
---
|
|
22
|
+
tags:
|
|
23
|
+
- Crud
|
|
24
|
+
description: Retrieve all preview background files. Supports
|
|
25
|
+
filtering via query parameters and pagination.
|
|
26
|
+
parameters:
|
|
27
|
+
- in: query
|
|
28
|
+
name: page
|
|
29
|
+
required: false
|
|
30
|
+
schema:
|
|
31
|
+
type: integer
|
|
32
|
+
example: 1
|
|
33
|
+
description: Page number for pagination
|
|
34
|
+
- in: query
|
|
35
|
+
name: limit
|
|
36
|
+
required: false
|
|
37
|
+
schema:
|
|
38
|
+
type: integer
|
|
39
|
+
example: 50
|
|
40
|
+
description: Number of results per page
|
|
41
|
+
- in: query
|
|
42
|
+
name: relations
|
|
43
|
+
required: false
|
|
44
|
+
schema:
|
|
45
|
+
type: boolean
|
|
46
|
+
default: false
|
|
47
|
+
example: false
|
|
48
|
+
description: Whether to include relations
|
|
49
|
+
responses:
|
|
50
|
+
200:
|
|
51
|
+
description: Preview background files retrieved successfully
|
|
52
|
+
content:
|
|
53
|
+
application/json:
|
|
54
|
+
schema:
|
|
55
|
+
oneOf:
|
|
56
|
+
- type: array
|
|
57
|
+
items:
|
|
58
|
+
type: object
|
|
59
|
+
- type: object
|
|
60
|
+
properties:
|
|
61
|
+
data:
|
|
62
|
+
type: array
|
|
63
|
+
items:
|
|
64
|
+
type: object
|
|
65
|
+
example: []
|
|
66
|
+
total:
|
|
67
|
+
type: integer
|
|
68
|
+
example: 100
|
|
69
|
+
nb_pages:
|
|
70
|
+
type: integer
|
|
71
|
+
example: 2
|
|
72
|
+
limit:
|
|
73
|
+
type: integer
|
|
74
|
+
example: 50
|
|
75
|
+
offset:
|
|
76
|
+
type: integer
|
|
77
|
+
example: 0
|
|
78
|
+
page:
|
|
79
|
+
type: integer
|
|
80
|
+
example: 1
|
|
81
|
+
400:
|
|
82
|
+
description: Invalid filter format or query error
|
|
83
|
+
"""
|
|
84
|
+
return super().get()
|
|
85
|
+
|
|
86
|
+
@jwt_required()
|
|
87
|
+
def post(self):
|
|
88
|
+
"""
|
|
89
|
+
Create preview background file
|
|
90
|
+
---
|
|
91
|
+
tags:
|
|
92
|
+
- Crud
|
|
93
|
+
description: Create a new preview background file with data
|
|
94
|
+
provided in the request body. JSON format is expected.
|
|
95
|
+
Names must be unique. If is_default is true, resets other
|
|
96
|
+
defaults.
|
|
97
|
+
requestBody:
|
|
98
|
+
required: true
|
|
99
|
+
content:
|
|
100
|
+
application/json:
|
|
101
|
+
schema:
|
|
102
|
+
type: object
|
|
103
|
+
required:
|
|
104
|
+
- name
|
|
105
|
+
properties:
|
|
106
|
+
name:
|
|
107
|
+
type: string
|
|
108
|
+
example: background_file_name
|
|
109
|
+
is_default:
|
|
110
|
+
type: boolean
|
|
111
|
+
default: false
|
|
112
|
+
example: false
|
|
113
|
+
responses:
|
|
114
|
+
201:
|
|
115
|
+
description: Preview background file created successfully
|
|
116
|
+
content:
|
|
117
|
+
application/json:
|
|
118
|
+
schema:
|
|
119
|
+
type: object
|
|
120
|
+
properties:
|
|
121
|
+
id:
|
|
122
|
+
type: string
|
|
123
|
+
format: uuid
|
|
124
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
125
|
+
name:
|
|
126
|
+
type: string
|
|
127
|
+
example: background_file_name
|
|
128
|
+
is_default:
|
|
129
|
+
type: boolean
|
|
130
|
+
example: false
|
|
131
|
+
created_at:
|
|
132
|
+
type: string
|
|
133
|
+
format: date-time
|
|
134
|
+
example: "2024-01-15T10:30:00Z"
|
|
135
|
+
updated_at:
|
|
136
|
+
type: string
|
|
137
|
+
format: date-time
|
|
138
|
+
example: "2024-01-15T10:30:00Z"
|
|
139
|
+
400:
|
|
140
|
+
description: Invalid data format or name already exists
|
|
141
|
+
"""
|
|
142
|
+
return super().post()
|
|
143
|
+
|
|
15
144
|
def update_data(self, data):
|
|
16
145
|
data = super().update_data(data)
|
|
17
146
|
name = data.get("name", None)
|
|
@@ -36,6 +165,149 @@ class PreviewBackgroundFileResource(BaseModelResource):
|
|
|
36
165
|
def check_read_permissions(self, instance):
|
|
37
166
|
return True
|
|
38
167
|
|
|
168
|
+
@jwt_required()
|
|
169
|
+
def get(self, instance_id):
|
|
170
|
+
"""
|
|
171
|
+
Get preview background file
|
|
172
|
+
---
|
|
173
|
+
tags:
|
|
174
|
+
- Crud
|
|
175
|
+
description: Retrieve a preview background file by its ID and
|
|
176
|
+
return it as a JSON object. Supports including relations.
|
|
177
|
+
parameters:
|
|
178
|
+
- in: path
|
|
179
|
+
name: instance_id
|
|
180
|
+
required: true
|
|
181
|
+
schema:
|
|
182
|
+
type: string
|
|
183
|
+
format: uuid
|
|
184
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
185
|
+
- in: query
|
|
186
|
+
name: relations
|
|
187
|
+
required: false
|
|
188
|
+
schema:
|
|
189
|
+
type: boolean
|
|
190
|
+
default: true
|
|
191
|
+
example: true
|
|
192
|
+
description: Whether to include relations
|
|
193
|
+
responses:
|
|
194
|
+
200:
|
|
195
|
+
description: Preview background file retrieved successfully
|
|
196
|
+
content:
|
|
197
|
+
application/json:
|
|
198
|
+
schema:
|
|
199
|
+
type: object
|
|
200
|
+
properties:
|
|
201
|
+
id:
|
|
202
|
+
type: string
|
|
203
|
+
format: uuid
|
|
204
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
205
|
+
name:
|
|
206
|
+
type: string
|
|
207
|
+
example: background_file_name
|
|
208
|
+
is_default:
|
|
209
|
+
type: boolean
|
|
210
|
+
example: false
|
|
211
|
+
created_at:
|
|
212
|
+
type: string
|
|
213
|
+
format: date-time
|
|
214
|
+
example: "2024-01-15T10:30:00Z"
|
|
215
|
+
updated_at:
|
|
216
|
+
type: string
|
|
217
|
+
format: date-time
|
|
218
|
+
example: "2024-01-15T10:30:00Z"
|
|
219
|
+
400:
|
|
220
|
+
description: Invalid ID format or query error
|
|
221
|
+
"""
|
|
222
|
+
return super().get(instance_id)
|
|
223
|
+
|
|
224
|
+
@jwt_required()
|
|
225
|
+
def put(self, instance_id):
|
|
226
|
+
"""
|
|
227
|
+
Update preview background file
|
|
228
|
+
---
|
|
229
|
+
tags:
|
|
230
|
+
- Crud
|
|
231
|
+
description: Update a preview background file with data provided
|
|
232
|
+
in the request body. JSON format is expected. Names must be
|
|
233
|
+
unique. If is_default is set to true, resets other defaults.
|
|
234
|
+
parameters:
|
|
235
|
+
- in: path
|
|
236
|
+
name: instance_id
|
|
237
|
+
required: true
|
|
238
|
+
schema:
|
|
239
|
+
type: string
|
|
240
|
+
format: uuid
|
|
241
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
242
|
+
requestBody:
|
|
243
|
+
required: true
|
|
244
|
+
content:
|
|
245
|
+
application/json:
|
|
246
|
+
schema:
|
|
247
|
+
type: object
|
|
248
|
+
properties:
|
|
249
|
+
name:
|
|
250
|
+
type: string
|
|
251
|
+
example: updated_background_file_name
|
|
252
|
+
is_default:
|
|
253
|
+
type: boolean
|
|
254
|
+
example: true
|
|
255
|
+
responses:
|
|
256
|
+
200:
|
|
257
|
+
description: Preview background file updated successfully
|
|
258
|
+
content:
|
|
259
|
+
application/json:
|
|
260
|
+
schema:
|
|
261
|
+
type: object
|
|
262
|
+
properties:
|
|
263
|
+
id:
|
|
264
|
+
type: string
|
|
265
|
+
format: uuid
|
|
266
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
267
|
+
name:
|
|
268
|
+
type: string
|
|
269
|
+
example: updated_background_file_name
|
|
270
|
+
is_default:
|
|
271
|
+
type: boolean
|
|
272
|
+
example: true
|
|
273
|
+
created_at:
|
|
274
|
+
type: string
|
|
275
|
+
format: date-time
|
|
276
|
+
example: "2024-01-15T10:30:00Z"
|
|
277
|
+
updated_at:
|
|
278
|
+
type: string
|
|
279
|
+
format: date-time
|
|
280
|
+
example: "2024-01-15T11:00:00Z"
|
|
281
|
+
400:
|
|
282
|
+
description: Invalid data format or name already exists
|
|
283
|
+
"""
|
|
284
|
+
return super().put(instance_id)
|
|
285
|
+
|
|
286
|
+
@jwt_required()
|
|
287
|
+
def delete(self, instance_id):
|
|
288
|
+
"""
|
|
289
|
+
Delete preview background file
|
|
290
|
+
---
|
|
291
|
+
tags:
|
|
292
|
+
- Crud
|
|
293
|
+
description: Delete a preview background file by its ID. Returns
|
|
294
|
+
empty response on success.
|
|
295
|
+
parameters:
|
|
296
|
+
- in: path
|
|
297
|
+
name: instance_id
|
|
298
|
+
required: true
|
|
299
|
+
schema:
|
|
300
|
+
type: string
|
|
301
|
+
format: uuid
|
|
302
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
303
|
+
responses:
|
|
304
|
+
204:
|
|
305
|
+
description: Preview background file deleted successfully
|
|
306
|
+
400:
|
|
307
|
+
description: Integrity error or cannot delete
|
|
308
|
+
"""
|
|
309
|
+
return super().delete(instance_id)
|
|
310
|
+
|
|
39
311
|
def update_data(self, data, instance_id):
|
|
40
312
|
data = super().update_data(data, instance_id)
|
|
41
313
|
name = data.get("name", None)
|
|
@@ -21,6 +21,141 @@ class PreviewFilesResource(BaseModelsResource):
|
|
|
21
21
|
def __init__(self):
|
|
22
22
|
BaseModelsResource.__init__(self, PreviewFile)
|
|
23
23
|
|
|
24
|
+
@jwt_required()
|
|
25
|
+
def get(self):
|
|
26
|
+
"""
|
|
27
|
+
Get preview files
|
|
28
|
+
---
|
|
29
|
+
tags:
|
|
30
|
+
- Crud
|
|
31
|
+
description: Retrieve all preview files. Supports filtering via
|
|
32
|
+
query parameters and pagination. Includes project permission
|
|
33
|
+
filtering. Vendor users only see assigned tasks.
|
|
34
|
+
parameters:
|
|
35
|
+
- in: query
|
|
36
|
+
name: page
|
|
37
|
+
required: false
|
|
38
|
+
schema:
|
|
39
|
+
type: integer
|
|
40
|
+
example: 1
|
|
41
|
+
description: Page number for pagination
|
|
42
|
+
- in: query
|
|
43
|
+
name: limit
|
|
44
|
+
required: false
|
|
45
|
+
schema:
|
|
46
|
+
type: integer
|
|
47
|
+
example: 50
|
|
48
|
+
description: Number of results per page
|
|
49
|
+
- in: query
|
|
50
|
+
name: relations
|
|
51
|
+
required: false
|
|
52
|
+
schema:
|
|
53
|
+
type: boolean
|
|
54
|
+
default: false
|
|
55
|
+
example: false
|
|
56
|
+
description: Whether to include relations
|
|
57
|
+
responses:
|
|
58
|
+
200:
|
|
59
|
+
description: Preview files retrieved successfully
|
|
60
|
+
content:
|
|
61
|
+
application/json:
|
|
62
|
+
schema:
|
|
63
|
+
oneOf:
|
|
64
|
+
- type: array
|
|
65
|
+
items:
|
|
66
|
+
type: object
|
|
67
|
+
- type: object
|
|
68
|
+
properties:
|
|
69
|
+
data:
|
|
70
|
+
type: array
|
|
71
|
+
items:
|
|
72
|
+
type: object
|
|
73
|
+
example: []
|
|
74
|
+
total:
|
|
75
|
+
type: integer
|
|
76
|
+
example: 100
|
|
77
|
+
nb_pages:
|
|
78
|
+
type: integer
|
|
79
|
+
example: 2
|
|
80
|
+
limit:
|
|
81
|
+
type: integer
|
|
82
|
+
example: 50
|
|
83
|
+
offset:
|
|
84
|
+
type: integer
|
|
85
|
+
example: 0
|
|
86
|
+
page:
|
|
87
|
+
type: integer
|
|
88
|
+
example: 1
|
|
89
|
+
400:
|
|
90
|
+
description: Invalid filter format or query error
|
|
91
|
+
"""
|
|
92
|
+
return super().get()
|
|
93
|
+
|
|
94
|
+
@jwt_required()
|
|
95
|
+
def post(self):
|
|
96
|
+
"""
|
|
97
|
+
Create preview file
|
|
98
|
+
---
|
|
99
|
+
tags:
|
|
100
|
+
- Crud
|
|
101
|
+
description: Create a new preview file with data provided in the
|
|
102
|
+
request body. JSON format is expected.
|
|
103
|
+
requestBody:
|
|
104
|
+
required: true
|
|
105
|
+
content:
|
|
106
|
+
application/json:
|
|
107
|
+
schema:
|
|
108
|
+
type: object
|
|
109
|
+
required:
|
|
110
|
+
- name
|
|
111
|
+
- task_id
|
|
112
|
+
properties:
|
|
113
|
+
name:
|
|
114
|
+
type: string
|
|
115
|
+
example: preview_file_v001
|
|
116
|
+
task_id:
|
|
117
|
+
type: string
|
|
118
|
+
format: uuid
|
|
119
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
120
|
+
revision:
|
|
121
|
+
type: integer
|
|
122
|
+
default: 1
|
|
123
|
+
example: 1
|
|
124
|
+
responses:
|
|
125
|
+
201:
|
|
126
|
+
description: Preview file created successfully
|
|
127
|
+
content:
|
|
128
|
+
application/json:
|
|
129
|
+
schema:
|
|
130
|
+
type: object
|
|
131
|
+
properties:
|
|
132
|
+
id:
|
|
133
|
+
type: string
|
|
134
|
+
format: uuid
|
|
135
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
136
|
+
name:
|
|
137
|
+
type: string
|
|
138
|
+
example: preview_file_v001
|
|
139
|
+
task_id:
|
|
140
|
+
type: string
|
|
141
|
+
format: uuid
|
|
142
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
143
|
+
revision:
|
|
144
|
+
type: integer
|
|
145
|
+
example: 1
|
|
146
|
+
created_at:
|
|
147
|
+
type: string
|
|
148
|
+
format: date-time
|
|
149
|
+
example: "2024-01-15T10:30:00Z"
|
|
150
|
+
updated_at:
|
|
151
|
+
type: string
|
|
152
|
+
format: date-time
|
|
153
|
+
example: "2024-01-15T10:30:00Z"
|
|
154
|
+
400:
|
|
155
|
+
description: Invalid data format or validation error
|
|
156
|
+
"""
|
|
157
|
+
return super().post()
|
|
158
|
+
|
|
24
159
|
def add_project_permission_filter(self, query):
|
|
25
160
|
if not permissions.has_admin_permissions():
|
|
26
161
|
query = (
|
|
@@ -61,6 +196,133 @@ class PreviewFileResource(BaseModelResource):
|
|
|
61
196
|
user_service.check_project_access(task["project_id"])
|
|
62
197
|
return True
|
|
63
198
|
|
|
199
|
+
@jwt_required()
|
|
200
|
+
def get(self, instance_id):
|
|
201
|
+
"""
|
|
202
|
+
Get preview file
|
|
203
|
+
---
|
|
204
|
+
tags:
|
|
205
|
+
- Crud
|
|
206
|
+
description: Retrieve a preview file by its ID and return it as
|
|
207
|
+
a JSON object. Supports including relations. Vendors must be
|
|
208
|
+
working on the task. Artists must have project access.
|
|
209
|
+
parameters:
|
|
210
|
+
- in: path
|
|
211
|
+
name: instance_id
|
|
212
|
+
required: true
|
|
213
|
+
schema:
|
|
214
|
+
type: string
|
|
215
|
+
format: uuid
|
|
216
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
217
|
+
- in: query
|
|
218
|
+
name: relations
|
|
219
|
+
required: false
|
|
220
|
+
schema:
|
|
221
|
+
type: boolean
|
|
222
|
+
default: true
|
|
223
|
+
example: true
|
|
224
|
+
description: Whether to include relations
|
|
225
|
+
responses:
|
|
226
|
+
200:
|
|
227
|
+
description: Preview file retrieved successfully
|
|
228
|
+
content:
|
|
229
|
+
application/json:
|
|
230
|
+
schema:
|
|
231
|
+
type: object
|
|
232
|
+
properties:
|
|
233
|
+
id:
|
|
234
|
+
type: string
|
|
235
|
+
format: uuid
|
|
236
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
237
|
+
name:
|
|
238
|
+
type: string
|
|
239
|
+
example: preview_file_v001
|
|
240
|
+
task_id:
|
|
241
|
+
type: string
|
|
242
|
+
format: uuid
|
|
243
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
244
|
+
revision:
|
|
245
|
+
type: integer
|
|
246
|
+
example: 1
|
|
247
|
+
created_at:
|
|
248
|
+
type: string
|
|
249
|
+
format: date-time
|
|
250
|
+
example: "2024-01-15T10:30:00Z"
|
|
251
|
+
updated_at:
|
|
252
|
+
type: string
|
|
253
|
+
format: date-time
|
|
254
|
+
example: "2024-01-15T10:30:00Z"
|
|
255
|
+
400:
|
|
256
|
+
description: Invalid ID format or query error
|
|
257
|
+
"""
|
|
258
|
+
return super().get(instance_id)
|
|
259
|
+
|
|
260
|
+
@jwt_required()
|
|
261
|
+
def put(self, instance_id):
|
|
262
|
+
"""
|
|
263
|
+
Update preview file
|
|
264
|
+
---
|
|
265
|
+
tags:
|
|
266
|
+
- Crud
|
|
267
|
+
description: Update a preview file with data provided in the
|
|
268
|
+
request body. JSON format is expected. Requires project access.
|
|
269
|
+
Non-managers must be working on the task.
|
|
270
|
+
parameters:
|
|
271
|
+
- in: path
|
|
272
|
+
name: instance_id
|
|
273
|
+
required: true
|
|
274
|
+
schema:
|
|
275
|
+
type: string
|
|
276
|
+
format: uuid
|
|
277
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
278
|
+
requestBody:
|
|
279
|
+
required: true
|
|
280
|
+
content:
|
|
281
|
+
application/json:
|
|
282
|
+
schema:
|
|
283
|
+
type: object
|
|
284
|
+
properties:
|
|
285
|
+
name:
|
|
286
|
+
type: string
|
|
287
|
+
example: updated_preview_file_v001
|
|
288
|
+
revision:
|
|
289
|
+
type: integer
|
|
290
|
+
example: 2
|
|
291
|
+
responses:
|
|
292
|
+
200:
|
|
293
|
+
description: Preview file updated successfully
|
|
294
|
+
content:
|
|
295
|
+
application/json:
|
|
296
|
+
schema:
|
|
297
|
+
type: object
|
|
298
|
+
properties:
|
|
299
|
+
id:
|
|
300
|
+
type: string
|
|
301
|
+
format: uuid
|
|
302
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
303
|
+
name:
|
|
304
|
+
type: string
|
|
305
|
+
example: updated_preview_file_v001
|
|
306
|
+
task_id:
|
|
307
|
+
type: string
|
|
308
|
+
format: uuid
|
|
309
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
310
|
+
revision:
|
|
311
|
+
type: integer
|
|
312
|
+
example: 2
|
|
313
|
+
created_at:
|
|
314
|
+
type: string
|
|
315
|
+
format: date-time
|
|
316
|
+
example: "2024-01-15T10:30:00Z"
|
|
317
|
+
updated_at:
|
|
318
|
+
type: string
|
|
319
|
+
format: date-time
|
|
320
|
+
example: "2024-01-15T11:00:00Z"
|
|
321
|
+
400:
|
|
322
|
+
description: Invalid data format or validation error
|
|
323
|
+
"""
|
|
324
|
+
return super().put(instance_id)
|
|
325
|
+
|
|
64
326
|
def check_update_permissions(self, preview_file, data):
|
|
65
327
|
task = tasks_service.get_task(preview_file["task_id"])
|
|
66
328
|
user_service.check_project_access(task["project_id"])
|
|
@@ -76,25 +338,34 @@ class PreviewFileResource(BaseModelResource):
|
|
|
76
338
|
@jwt_required()
|
|
77
339
|
def delete(self, instance_id):
|
|
78
340
|
"""
|
|
79
|
-
Delete
|
|
80
|
-
a 204 status code.
|
|
341
|
+
Delete preview file
|
|
81
342
|
---
|
|
82
343
|
tags:
|
|
83
344
|
- Crud
|
|
345
|
+
description: Delete a preview file by its ID. Returns empty
|
|
346
|
+
response on success. May require force flag if file has
|
|
347
|
+
associated data.
|
|
84
348
|
parameters:
|
|
85
349
|
- in: path
|
|
86
350
|
name: instance_id
|
|
87
|
-
required:
|
|
88
|
-
|
|
89
|
-
|
|
351
|
+
required: true
|
|
352
|
+
schema:
|
|
353
|
+
type: string
|
|
354
|
+
format: uuid
|
|
90
355
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
356
|
+
- in: query
|
|
357
|
+
name: force
|
|
358
|
+
required: false
|
|
359
|
+
schema:
|
|
360
|
+
type: boolean
|
|
361
|
+
default: false
|
|
362
|
+
example: false
|
|
363
|
+
description: Force deletion even if file has associated data
|
|
91
364
|
responses:
|
|
92
365
|
204:
|
|
93
|
-
|
|
366
|
+
description: Preview file deleted successfully
|
|
94
367
|
400:
|
|
95
|
-
|
|
96
|
-
404:
|
|
97
|
-
description: Instance non-existant
|
|
368
|
+
description: Integrity error or cannot delete
|
|
98
369
|
"""
|
|
99
370
|
instance = self.get_model_or_404(instance_id)
|
|
100
371
|
|