zou 0.20.82__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/assets/resources.py +1060 -153
- zou/app/blueprints/auth/resources.py +368 -238
- zou/app/blueprints/breakdown/resources.py +584 -94
- zou/app/blueprints/chats/resources.py +176 -37
- zou/app/blueprints/comments/resources.py +409 -150
- zou/app/blueprints/concepts/resources.py +443 -63
- 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/departments/resources.py +302 -68
- zou/app/blueprints/edits/resources.py +651 -81
- zou/app/blueprints/entities/resources.py +104 -39
- zou/app/blueprints/events/resources.py +96 -8
- 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/index/resources.py +49 -42
- zou/app/blueprints/news/resources.py +47 -27
- 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/blueprints/user/resources.py +1808 -215
- 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/app/swagger.py +100 -27
- zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/RECORD +114 -113
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
- {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.82.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.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
2
4
|
|
|
3
5
|
from zou.app.models.department import Department
|
|
@@ -12,6 +14,130 @@ class DepartmentsResource(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 departments
|
|
21
|
+
---
|
|
22
|
+
tags:
|
|
23
|
+
- Crud
|
|
24
|
+
description: Retrieve all departments. Supports filtering via query
|
|
25
|
+
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: Departments 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 department
|
|
90
|
+
---
|
|
91
|
+
tags:
|
|
92
|
+
- Crud
|
|
93
|
+
description: Create a new department with data provided in the
|
|
94
|
+
request body. JSON format is expected.
|
|
95
|
+
requestBody:
|
|
96
|
+
required: true
|
|
97
|
+
content:
|
|
98
|
+
application/json:
|
|
99
|
+
schema:
|
|
100
|
+
type: object
|
|
101
|
+
required:
|
|
102
|
+
- name
|
|
103
|
+
properties:
|
|
104
|
+
name:
|
|
105
|
+
type: string
|
|
106
|
+
example: Animation
|
|
107
|
+
color:
|
|
108
|
+
type: string
|
|
109
|
+
example: "#FF5733"
|
|
110
|
+
responses:
|
|
111
|
+
201:
|
|
112
|
+
description: Department created successfully
|
|
113
|
+
content:
|
|
114
|
+
application/json:
|
|
115
|
+
schema:
|
|
116
|
+
type: object
|
|
117
|
+
properties:
|
|
118
|
+
id:
|
|
119
|
+
type: string
|
|
120
|
+
format: uuid
|
|
121
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
122
|
+
name:
|
|
123
|
+
type: string
|
|
124
|
+
example: Animation
|
|
125
|
+
color:
|
|
126
|
+
type: string
|
|
127
|
+
example: "#FF5733"
|
|
128
|
+
created_at:
|
|
129
|
+
type: string
|
|
130
|
+
format: date-time
|
|
131
|
+
example: "2024-01-15T10:30:00Z"
|
|
132
|
+
updated_at:
|
|
133
|
+
type: string
|
|
134
|
+
format: date-time
|
|
135
|
+
example: "2024-01-15T10:30:00Z"
|
|
136
|
+
400:
|
|
137
|
+
description: Invalid data format or validation error
|
|
138
|
+
"""
|
|
139
|
+
return super().post()
|
|
140
|
+
|
|
15
141
|
def post_creation(self, instance):
|
|
16
142
|
tasks_service.clear_department_cache(str(instance.id))
|
|
17
143
|
return instance.serialize()
|
|
@@ -24,6 +150,148 @@ class DepartmentResource(BaseModelResource):
|
|
|
24
150
|
def check_read_permissions(self, instance):
|
|
25
151
|
return True
|
|
26
152
|
|
|
153
|
+
@jwt_required()
|
|
154
|
+
def get(self, instance_id):
|
|
155
|
+
"""
|
|
156
|
+
Get department
|
|
157
|
+
---
|
|
158
|
+
tags:
|
|
159
|
+
- Crud
|
|
160
|
+
description: Retrieve a department by its ID and return it as a
|
|
161
|
+
JSON object. Supports including relations.
|
|
162
|
+
parameters:
|
|
163
|
+
- in: path
|
|
164
|
+
name: instance_id
|
|
165
|
+
required: true
|
|
166
|
+
schema:
|
|
167
|
+
type: string
|
|
168
|
+
format: uuid
|
|
169
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
170
|
+
- in: query
|
|
171
|
+
name: relations
|
|
172
|
+
required: false
|
|
173
|
+
schema:
|
|
174
|
+
type: boolean
|
|
175
|
+
default: true
|
|
176
|
+
example: true
|
|
177
|
+
description: Whether to include relations
|
|
178
|
+
responses:
|
|
179
|
+
200:
|
|
180
|
+
description: Department retrieved successfully
|
|
181
|
+
content:
|
|
182
|
+
application/json:
|
|
183
|
+
schema:
|
|
184
|
+
type: object
|
|
185
|
+
properties:
|
|
186
|
+
id:
|
|
187
|
+
type: string
|
|
188
|
+
format: uuid
|
|
189
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
190
|
+
name:
|
|
191
|
+
type: string
|
|
192
|
+
example: Animation
|
|
193
|
+
color:
|
|
194
|
+
type: string
|
|
195
|
+
example: "#FF5733"
|
|
196
|
+
created_at:
|
|
197
|
+
type: string
|
|
198
|
+
format: date-time
|
|
199
|
+
example: "2024-01-15T10:30:00Z"
|
|
200
|
+
updated_at:
|
|
201
|
+
type: string
|
|
202
|
+
format: date-time
|
|
203
|
+
example: "2024-01-15T10:30:00Z"
|
|
204
|
+
400:
|
|
205
|
+
description: Invalid ID format or query error
|
|
206
|
+
"""
|
|
207
|
+
return super().get(instance_id)
|
|
208
|
+
|
|
209
|
+
@jwt_required()
|
|
210
|
+
def put(self, instance_id):
|
|
211
|
+
"""
|
|
212
|
+
Update department
|
|
213
|
+
---
|
|
214
|
+
tags:
|
|
215
|
+
- Crud
|
|
216
|
+
description: Update a department with data provided in the request
|
|
217
|
+
body. JSON format is expected.
|
|
218
|
+
parameters:
|
|
219
|
+
- in: path
|
|
220
|
+
name: instance_id
|
|
221
|
+
required: true
|
|
222
|
+
schema:
|
|
223
|
+
type: string
|
|
224
|
+
format: uuid
|
|
225
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
226
|
+
requestBody:
|
|
227
|
+
required: true
|
|
228
|
+
content:
|
|
229
|
+
application/json:
|
|
230
|
+
schema:
|
|
231
|
+
type: object
|
|
232
|
+
properties:
|
|
233
|
+
name:
|
|
234
|
+
type: string
|
|
235
|
+
example: Updated Animation
|
|
236
|
+
color:
|
|
237
|
+
type: string
|
|
238
|
+
example: "#FF5734"
|
|
239
|
+
responses:
|
|
240
|
+
200:
|
|
241
|
+
description: Department updated successfully
|
|
242
|
+
content:
|
|
243
|
+
application/json:
|
|
244
|
+
schema:
|
|
245
|
+
type: object
|
|
246
|
+
properties:
|
|
247
|
+
id:
|
|
248
|
+
type: string
|
|
249
|
+
format: uuid
|
|
250
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
251
|
+
name:
|
|
252
|
+
type: string
|
|
253
|
+
example: Updated Animation
|
|
254
|
+
color:
|
|
255
|
+
type: string
|
|
256
|
+
example: "#FF5734"
|
|
257
|
+
created_at:
|
|
258
|
+
type: string
|
|
259
|
+
format: date-time
|
|
260
|
+
example: "2024-01-15T10:30:00Z"
|
|
261
|
+
updated_at:
|
|
262
|
+
type: string
|
|
263
|
+
format: date-time
|
|
264
|
+
example: "2024-01-15T11:00:00Z"
|
|
265
|
+
400:
|
|
266
|
+
description: Invalid data format or validation error
|
|
267
|
+
"""
|
|
268
|
+
return super().put(instance_id)
|
|
269
|
+
|
|
270
|
+
@jwt_required()
|
|
271
|
+
def delete(self, instance_id):
|
|
272
|
+
"""
|
|
273
|
+
Delete department
|
|
274
|
+
---
|
|
275
|
+
tags:
|
|
276
|
+
- Crud
|
|
277
|
+
description: Delete a department by its ID. Returns empty response
|
|
278
|
+
on success.
|
|
279
|
+
parameters:
|
|
280
|
+
- in: path
|
|
281
|
+
name: instance_id
|
|
282
|
+
required: true
|
|
283
|
+
schema:
|
|
284
|
+
type: string
|
|
285
|
+
format: uuid
|
|
286
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
287
|
+
responses:
|
|
288
|
+
204:
|
|
289
|
+
description: Department deleted successfully
|
|
290
|
+
400:
|
|
291
|
+
description: Integrity error or cannot delete
|
|
292
|
+
"""
|
|
293
|
+
return super().delete(instance_id)
|
|
294
|
+
|
|
27
295
|
def post_update(self, instance_dict, data):
|
|
28
296
|
tasks_service.clear_department_cache(instance_dict["id"])
|
|
29
297
|
return instance_dict
|
|
@@ -58,6 +58,156 @@ class EntitiesResource(BaseModelsResource, EntityEventMixin):
|
|
|
58
58
|
def check_create_permissions(self, entity):
|
|
59
59
|
user_service.check_manager_project_access(entity["project_id"])
|
|
60
60
|
|
|
61
|
+
@jwt_required()
|
|
62
|
+
def get(self):
|
|
63
|
+
"""
|
|
64
|
+
Get entities
|
|
65
|
+
---
|
|
66
|
+
tags:
|
|
67
|
+
- Crud
|
|
68
|
+
description: Retrieve all entities. Supports filtering via query
|
|
69
|
+
parameters and pagination. Includes project permission filtering
|
|
70
|
+
for non-admin users.
|
|
71
|
+
parameters:
|
|
72
|
+
- in: query
|
|
73
|
+
name: page
|
|
74
|
+
required: false
|
|
75
|
+
schema:
|
|
76
|
+
type: integer
|
|
77
|
+
example: 1
|
|
78
|
+
description: Page number for pagination
|
|
79
|
+
- in: query
|
|
80
|
+
name: limit
|
|
81
|
+
required: false
|
|
82
|
+
schema:
|
|
83
|
+
type: integer
|
|
84
|
+
example: 50
|
|
85
|
+
description: Number of results per page
|
|
86
|
+
- in: query
|
|
87
|
+
name: relations
|
|
88
|
+
required: false
|
|
89
|
+
schema:
|
|
90
|
+
type: boolean
|
|
91
|
+
default: false
|
|
92
|
+
example: false
|
|
93
|
+
description: Whether to include relations
|
|
94
|
+
responses:
|
|
95
|
+
200:
|
|
96
|
+
description: Entities retrieved successfully
|
|
97
|
+
content:
|
|
98
|
+
application/json:
|
|
99
|
+
schema:
|
|
100
|
+
oneOf:
|
|
101
|
+
- type: array
|
|
102
|
+
items:
|
|
103
|
+
type: object
|
|
104
|
+
- type: object
|
|
105
|
+
properties:
|
|
106
|
+
data:
|
|
107
|
+
type: array
|
|
108
|
+
items:
|
|
109
|
+
type: object
|
|
110
|
+
example: []
|
|
111
|
+
total:
|
|
112
|
+
type: integer
|
|
113
|
+
example: 100
|
|
114
|
+
nb_pages:
|
|
115
|
+
type: integer
|
|
116
|
+
example: 2
|
|
117
|
+
limit:
|
|
118
|
+
type: integer
|
|
119
|
+
example: 50
|
|
120
|
+
offset:
|
|
121
|
+
type: integer
|
|
122
|
+
example: 0
|
|
123
|
+
page:
|
|
124
|
+
type: integer
|
|
125
|
+
example: 1
|
|
126
|
+
400:
|
|
127
|
+
description: Invalid filter format or query error
|
|
128
|
+
"""
|
|
129
|
+
return super().get()
|
|
130
|
+
|
|
131
|
+
@jwt_required()
|
|
132
|
+
def post(self):
|
|
133
|
+
"""
|
|
134
|
+
Create entity
|
|
135
|
+
---
|
|
136
|
+
tags:
|
|
137
|
+
- Crud
|
|
138
|
+
description: Create a new entity with data provided in the request
|
|
139
|
+
body. JSON format is expected. Requires manager access to the
|
|
140
|
+
project.
|
|
141
|
+
requestBody:
|
|
142
|
+
required: true
|
|
143
|
+
content:
|
|
144
|
+
application/json:
|
|
145
|
+
schema:
|
|
146
|
+
type: object
|
|
147
|
+
required:
|
|
148
|
+
- name
|
|
149
|
+
- project_id
|
|
150
|
+
- entity_type_id
|
|
151
|
+
properties:
|
|
152
|
+
name:
|
|
153
|
+
type: string
|
|
154
|
+
example: SH010
|
|
155
|
+
project_id:
|
|
156
|
+
type: string
|
|
157
|
+
format: uuid
|
|
158
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
159
|
+
entity_type_id:
|
|
160
|
+
type: string
|
|
161
|
+
format: uuid
|
|
162
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
163
|
+
status:
|
|
164
|
+
type: string
|
|
165
|
+
example: running
|
|
166
|
+
data:
|
|
167
|
+
type: object
|
|
168
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
169
|
+
responses:
|
|
170
|
+
201:
|
|
171
|
+
description: Entity created successfully
|
|
172
|
+
content:
|
|
173
|
+
application/json:
|
|
174
|
+
schema:
|
|
175
|
+
type: object
|
|
176
|
+
properties:
|
|
177
|
+
id:
|
|
178
|
+
type: string
|
|
179
|
+
format: uuid
|
|
180
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
181
|
+
name:
|
|
182
|
+
type: string
|
|
183
|
+
example: SH010
|
|
184
|
+
project_id:
|
|
185
|
+
type: string
|
|
186
|
+
format: uuid
|
|
187
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
188
|
+
entity_type_id:
|
|
189
|
+
type: string
|
|
190
|
+
format: uuid
|
|
191
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
192
|
+
status:
|
|
193
|
+
type: string
|
|
194
|
+
example: running
|
|
195
|
+
data:
|
|
196
|
+
type: object
|
|
197
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
198
|
+
created_at:
|
|
199
|
+
type: string
|
|
200
|
+
format: date-time
|
|
201
|
+
example: "2024-01-15T10:30:00Z"
|
|
202
|
+
updated_at:
|
|
203
|
+
type: string
|
|
204
|
+
format: date-time
|
|
205
|
+
example: "2024-01-15T10:30:00Z"
|
|
206
|
+
400:
|
|
207
|
+
description: Invalid data format or validation error
|
|
208
|
+
"""
|
|
209
|
+
return super().post()
|
|
210
|
+
|
|
61
211
|
def emit_create_event(self, entity_dict):
|
|
62
212
|
self.emit_event("new", entity_dict)
|
|
63
213
|
|
|
@@ -125,6 +275,101 @@ class EntityResource(BaseModelResource, EntityEventMixin):
|
|
|
125
275
|
def check_update_permissions(self, entity, data):
|
|
126
276
|
return user_service.check_metadata_department_access(entity, data)
|
|
127
277
|
|
|
278
|
+
@jwt_required()
|
|
279
|
+
def get(self, instance_id):
|
|
280
|
+
"""
|
|
281
|
+
Get entity
|
|
282
|
+
---
|
|
283
|
+
tags:
|
|
284
|
+
- Crud
|
|
285
|
+
description: Retrieve an entity by its ID and return it as a JSON
|
|
286
|
+
object. Supports including relations. Requires project access.
|
|
287
|
+
parameters:
|
|
288
|
+
- in: path
|
|
289
|
+
name: instance_id
|
|
290
|
+
required: true
|
|
291
|
+
schema:
|
|
292
|
+
type: string
|
|
293
|
+
format: uuid
|
|
294
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
295
|
+
- in: query
|
|
296
|
+
name: relations
|
|
297
|
+
required: false
|
|
298
|
+
schema:
|
|
299
|
+
type: boolean
|
|
300
|
+
default: true
|
|
301
|
+
example: true
|
|
302
|
+
description: Whether to include relations
|
|
303
|
+
responses:
|
|
304
|
+
200:
|
|
305
|
+
description: Entity retrieved successfully
|
|
306
|
+
content:
|
|
307
|
+
application/json:
|
|
308
|
+
schema:
|
|
309
|
+
type: object
|
|
310
|
+
properties:
|
|
311
|
+
id:
|
|
312
|
+
type: string
|
|
313
|
+
format: uuid
|
|
314
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
315
|
+
name:
|
|
316
|
+
type: string
|
|
317
|
+
example: SH010
|
|
318
|
+
project_id:
|
|
319
|
+
type: string
|
|
320
|
+
format: uuid
|
|
321
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
322
|
+
entity_type_id:
|
|
323
|
+
type: string
|
|
324
|
+
format: uuid
|
|
325
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
326
|
+
status:
|
|
327
|
+
type: string
|
|
328
|
+
example: running
|
|
329
|
+
data:
|
|
330
|
+
type: object
|
|
331
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
332
|
+
type:
|
|
333
|
+
type: string
|
|
334
|
+
example: shot
|
|
335
|
+
created_at:
|
|
336
|
+
type: string
|
|
337
|
+
format: date-time
|
|
338
|
+
example: "2024-01-15T10:30:00Z"
|
|
339
|
+
updated_at:
|
|
340
|
+
type: string
|
|
341
|
+
format: date-time
|
|
342
|
+
example: "2024-01-15T10:30:00Z"
|
|
343
|
+
400:
|
|
344
|
+
description: Invalid ID format or query error
|
|
345
|
+
"""
|
|
346
|
+
return super().get(instance_id)
|
|
347
|
+
|
|
348
|
+
@jwt_required()
|
|
349
|
+
def delete(self, instance_id):
|
|
350
|
+
"""
|
|
351
|
+
Delete entity
|
|
352
|
+
---
|
|
353
|
+
tags:
|
|
354
|
+
- Crud
|
|
355
|
+
description: Delete an entity by its ID. Returns empty response
|
|
356
|
+
on success. Can only be deleted by creator or project manager.
|
|
357
|
+
parameters:
|
|
358
|
+
- in: path
|
|
359
|
+
name: instance_id
|
|
360
|
+
required: true
|
|
361
|
+
schema:
|
|
362
|
+
type: string
|
|
363
|
+
format: uuid
|
|
364
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
365
|
+
responses:
|
|
366
|
+
204:
|
|
367
|
+
description: Entity deleted successfully
|
|
368
|
+
400:
|
|
369
|
+
description: Integrity error or cannot delete
|
|
370
|
+
"""
|
|
371
|
+
return super().delete(instance_id)
|
|
372
|
+
|
|
128
373
|
def check_delete_permissions(self, entity):
|
|
129
374
|
return entity["created_by"] == persons_service.get_current_user()[
|
|
130
375
|
"id"
|
|
@@ -142,9 +387,58 @@ class EntityResource(BaseModelResource, EntityEventMixin):
|
|
|
142
387
|
@jwt_required()
|
|
143
388
|
def put(self, instance_id):
|
|
144
389
|
"""
|
|
145
|
-
Update
|
|
146
|
-
|
|
147
|
-
|
|
390
|
+
Update entity
|
|
391
|
+
---
|
|
392
|
+
tags:
|
|
393
|
+
- Crud
|
|
394
|
+
description: Update an entity with data provided in the request
|
|
395
|
+
body. JSON format is expected. Supports shot versioning when
|
|
396
|
+
frame data changes.
|
|
397
|
+
parameters:
|
|
398
|
+
- in: path
|
|
399
|
+
name: instance_id
|
|
400
|
+
required: true
|
|
401
|
+
schema:
|
|
402
|
+
type: string
|
|
403
|
+
format: uuid
|
|
404
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
405
|
+
requestBody:
|
|
406
|
+
required: true
|
|
407
|
+
content:
|
|
408
|
+
application/json:
|
|
409
|
+
schema:
|
|
410
|
+
type: object
|
|
411
|
+
properties:
|
|
412
|
+
name:
|
|
413
|
+
type: string
|
|
414
|
+
example: SH010
|
|
415
|
+
data:
|
|
416
|
+
type: object
|
|
417
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
418
|
+
responses:
|
|
419
|
+
200:
|
|
420
|
+
description: Entity updated successfully
|
|
421
|
+
content:
|
|
422
|
+
application/json:
|
|
423
|
+
schema:
|
|
424
|
+
type: object
|
|
425
|
+
properties:
|
|
426
|
+
id:
|
|
427
|
+
type: string
|
|
428
|
+
format: uuid
|
|
429
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
430
|
+
name:
|
|
431
|
+
type: string
|
|
432
|
+
example: SH010
|
|
433
|
+
project_id:
|
|
434
|
+
type: string
|
|
435
|
+
format: uuid
|
|
436
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
437
|
+
data:
|
|
438
|
+
type: object
|
|
439
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
440
|
+
400:
|
|
441
|
+
description: Invalid data format or validation error
|
|
148
442
|
"""
|
|
149
443
|
try:
|
|
150
444
|
data = self.get_arguments()
|