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.
Files changed (103) hide show
  1. zou/__init__.py +1 -1
  2. zou/app/blueprints/comments/resources.py +32 -35
  3. zou/app/blueprints/concepts/resources.py +23 -8
  4. zou/app/blueprints/crud/asset_instance.py +272 -0
  5. zou/app/blueprints/crud/attachment_file.py +263 -0
  6. zou/app/blueprints/crud/base.py +176 -69
  7. zou/app/blueprints/crud/budget.py +278 -0
  8. zou/app/blueprints/crud/budget_entry.py +269 -0
  9. zou/app/blueprints/crud/chat.py +282 -0
  10. zou/app/blueprints/crud/chat_message.py +286 -0
  11. zou/app/blueprints/crud/comments.py +312 -1
  12. zou/app/blueprints/crud/custom_action.py +268 -0
  13. zou/app/blueprints/crud/day_off.py +298 -0
  14. zou/app/blueprints/crud/department.py +268 -0
  15. zou/app/blueprints/crud/entity.py +297 -3
  16. zou/app/blueprints/crud/entity_link.py +303 -0
  17. zou/app/blueprints/crud/entity_type.py +269 -0
  18. zou/app/blueprints/crud/event.py +197 -0
  19. zou/app/blueprints/crud/file_status.py +268 -0
  20. zou/app/blueprints/crud/hardware_item.py +268 -0
  21. zou/app/blueprints/crud/metadata_descriptor.py +312 -0
  22. zou/app/blueprints/crud/milestone.py +302 -1
  23. zou/app/blueprints/crud/news.py +285 -0
  24. zou/app/blueprints/crud/notification.py +287 -0
  25. zou/app/blueprints/crud/organisation.py +269 -0
  26. zou/app/blueprints/crud/output_file.py +34 -10
  27. zou/app/blueprints/crud/output_type.py +30 -10
  28. zou/app/blueprints/crud/person.py +407 -2
  29. zou/app/blueprints/crud/playlist.py +322 -4
  30. zou/app/blueprints/crud/plugin.py +269 -0
  31. zou/app/blueprints/crud/preview_background_file.py +272 -0
  32. zou/app/blueprints/crud/preview_file.py +280 -9
  33. zou/app/blueprints/crud/production_schedule_version.py +569 -0
  34. zou/app/blueprints/crud/project.py +440 -0
  35. zou/app/blueprints/crud/project_status.py +268 -0
  36. zou/app/blueprints/crud/salary_scale.py +185 -5
  37. zou/app/blueprints/crud/schedule_item.py +305 -0
  38. zou/app/blueprints/crud/search_filter.py +302 -0
  39. zou/app/blueprints/crud/search_filter_group.py +270 -0
  40. zou/app/blueprints/crud/software.py +30 -10
  41. zou/app/blueprints/crud/status_automation.py +296 -2
  42. zou/app/blueprints/crud/studio.py +268 -0
  43. zou/app/blueprints/crud/subscription.py +279 -0
  44. zou/app/blueprints/crud/task.py +325 -5
  45. zou/app/blueprints/crud/task_status.py +301 -0
  46. zou/app/blueprints/crud/task_type.py +283 -0
  47. zou/app/blueprints/crud/time_spent.py +327 -0
  48. zou/app/blueprints/crud/working_file.py +273 -10
  49. zou/app/blueprints/export/csv/assets.py +15 -5
  50. zou/app/blueprints/export/csv/base.py +12 -3
  51. zou/app/blueprints/export/csv/casting.py +32 -5
  52. zou/app/blueprints/export/csv/edits.py +15 -5
  53. zou/app/blueprints/export/csv/persons.py +24 -0
  54. zou/app/blueprints/export/csv/playlists.py +16 -5
  55. zou/app/blueprints/export/csv/projects.py +23 -0
  56. zou/app/blueprints/export/csv/shots.py +15 -5
  57. zou/app/blueprints/export/csv/task_types.py +23 -0
  58. zou/app/blueprints/export/csv/tasks.py +24 -0
  59. zou/app/blueprints/export/csv/time_spents.py +24 -0
  60. zou/app/blueprints/files/resources.py +928 -377
  61. zou/app/blueprints/news/resources.py +7 -5
  62. zou/app/blueprints/persons/resources.py +644 -271
  63. zou/app/blueprints/playlists/resources.py +154 -72
  64. zou/app/blueprints/previews/resources.py +473 -228
  65. zou/app/blueprints/projects/__init__.py +5 -0
  66. zou/app/blueprints/projects/resources.py +987 -420
  67. zou/app/blueprints/search/resources.py +44 -32
  68. zou/app/blueprints/shots/resources.py +1338 -88
  69. zou/app/blueprints/source/csv/assets.py +44 -6
  70. zou/app/blueprints/source/csv/casting.py +43 -6
  71. zou/app/blueprints/source/csv/edits.py +47 -9
  72. zou/app/blueprints/source/csv/persons.py +43 -4
  73. zou/app/blueprints/source/csv/shots.py +47 -6
  74. zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
  75. zou/app/blueprints/source/kitsu.py +433 -11
  76. zou/app/blueprints/source/otio.py +215 -20
  77. zou/app/blueprints/source/shotgun/assets.py +146 -0
  78. zou/app/blueprints/source/shotgun/base.py +85 -14
  79. zou/app/blueprints/source/shotgun/episode.py +124 -0
  80. zou/app/blueprints/source/shotgun/import_errors.py +105 -14
  81. zou/app/blueprints/source/shotgun/notes.py +132 -0
  82. zou/app/blueprints/source/shotgun/person.py +163 -0
  83. zou/app/blueprints/source/shotgun/project.py +120 -0
  84. zou/app/blueprints/source/shotgun/scene.py +120 -0
  85. zou/app/blueprints/source/shotgun/sequence.py +134 -0
  86. zou/app/blueprints/source/shotgun/shot.py +166 -0
  87. zou/app/blueprints/source/shotgun/status.py +129 -0
  88. zou/app/blueprints/source/shotgun/steps.py +138 -0
  89. zou/app/blueprints/source/shotgun/tasks.py +199 -0
  90. zou/app/blueprints/source/shotgun/team.py +132 -0
  91. zou/app/blueprints/source/shotgun/versions.py +155 -0
  92. zou/app/blueprints/tasks/resources.py +1197 -308
  93. zou/app/models/metadata_descriptor.py +1 -0
  94. zou/app/services/persons_service.py +1 -1
  95. zou/app/services/projects_service.py +45 -1
  96. zou/app/services/time_spents_service.py +1 -1
  97. zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
  98. {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
  99. {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/RECORD +103 -102
  100. {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
  101. {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
  102. {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
  103. {zou-0.20.83.dist-info → zou-0.20.84.dist-info}/top_level.txt +0 -0
@@ -41,8 +41,39 @@ mapping_substitutions_to_regex = {
41
41
 
42
42
 
43
43
  class OTIOBaseResource(Resource, ArgsMixin):
44
+
44
45
  @jwt_required()
45
46
  def post(self, project_id, episode_id=None):
47
+ """
48
+ Import otio base
49
+ ---
50
+ description: Base resource for importing OTIO files. This method is
51
+ overridden by subclasses. Import an OTIO file to set frame_in,
52
+ frame_out, and nb_frames for shots.
53
+ tags:
54
+ - Import
55
+ consumes:
56
+ - multipart/form-data
57
+ parameters:
58
+ - in: path
59
+ name: project_id
60
+ required: true
61
+ schema:
62
+ type: string
63
+ format: uuid
64
+ description: Project unique identifier
65
+ example: a24a6ea4-ce75-4665-a070-57453082c25
66
+ - in: formData
67
+ name: file
68
+ type: file
69
+ required: true
70
+ description: OTIO file to import (EDL, OTIO, etc.)
71
+ responses:
72
+ 201:
73
+ description: Shots imported successfully
74
+ 400:
75
+ description: Invalid file format or parsing error
76
+ """
46
77
  args = self.post_args()
47
78
  user_service.check_manager_project_access(project_id)
48
79
  uploaded_file = request.files["file"]
@@ -269,33 +300,114 @@ class OTIOBaseResource(Resource, ArgsMixin):
269
300
 
270
301
 
271
302
  class OTIOImportResource(OTIOBaseResource):
303
+
272
304
  @jwt_required()
273
305
  def post(self, **kwargs):
274
306
  """
275
- Import an OTIO file to enter frame_in / frame_out / nb_frames (it can
276
- be every adapter supported by OpenTimelineIO, for example: EDL, OTIO...
277
- ).
307
+ Import otio EDL
278
308
  ---
279
309
  tags:
280
310
  - Import
311
+ description: Import an OTIO file to set frame_in, frame_out, and
312
+ nb_frames for shots. Supports any OpenTimelineIO adapter format like
313
+ EDL or OTIO. Uses naming convention to match shots.
281
314
  consumes:
282
315
  - multipart/form-data
283
316
  parameters:
284
317
  - in: path
285
318
  name: project_id
286
- required: True
287
- type: string
288
- format: uuid
319
+ required: true
320
+ schema:
321
+ type: string
322
+ format: uuid
289
323
  example: a24a6ea4-ce75-4665-a070-57453082c25
324
+ - in: query
325
+ name: naming_convention
326
+ required: false
327
+ schema:
328
+ type: string
329
+ default: "${project_name}_${sequence_name}-${shot_name}"
330
+ example: "${project_name}_${sequence_name}-${shot_name}"
331
+ description: Template for matching shot names from the file
332
+ - in: query
333
+ name: match_case
334
+ required: false
335
+ schema:
336
+ type: boolean
337
+ default: true
338
+ example: true
339
+ description: Whether to match shot names case-sensitively
290
340
  - in: formData
291
341
  name: file
292
342
  type: file
293
343
  required: true
344
+ description: OTIO file to import (EDL, OTIO, etc.)
294
345
  responses:
295
346
  201:
296
- description: .
347
+ description: Shots imported successfully
348
+ content:
349
+ application/json:
350
+ schema:
351
+ type: object
352
+ properties:
353
+ updated_shots:
354
+ type: array
355
+ items:
356
+ type: object
357
+ properties:
358
+ id:
359
+ type: string
360
+ format: uuid
361
+ example: a24a6ea4-ce75-4665-a070-57453082c25
362
+ name:
363
+ type: string
364
+ example: SH010
365
+ project_id:
366
+ type: string
367
+ format: uuid
368
+ example: b24a6ea4-ce75-4665-a070-57453082c25
369
+ nb_frames:
370
+ type: integer
371
+ example: 120
372
+ data:
373
+ type: object
374
+ properties:
375
+ frame_in:
376
+ type: integer
377
+ example: 1001
378
+ frame_out:
379
+ type: integer
380
+ example: 1120
381
+ created_shots:
382
+ type: array
383
+ items:
384
+ type: object
385
+ properties:
386
+ id:
387
+ type: string
388
+ format: uuid
389
+ example: c24a6ea4-ce75-4665-a070-57453082c25
390
+ name:
391
+ type: string
392
+ example: SH020
393
+ project_id:
394
+ type: string
395
+ format: uuid
396
+ example: b24a6ea4-ce75-4665-a070-57453082c25
397
+ nb_frames:
398
+ type: integer
399
+ example: 96
400
+ data:
401
+ type: object
402
+ properties:
403
+ frame_in:
404
+ type: integer
405
+ example: 2001
406
+ frame_out:
407
+ type: integer
408
+ example: 2096
297
409
  400:
298
- description: The .otio file is not properly formatted.
410
+ description: Invalid file format or parsing error
299
411
  """
300
412
  return super().post(**kwargs)
301
413
 
@@ -314,39 +426,122 @@ class OTIOImportResource(OTIOBaseResource):
314
426
 
315
427
 
316
428
  class OTIOImportEpisodeResource(OTIOBaseResource):
429
+
317
430
  @jwt_required()
318
431
  def post(self, **kwargs):
319
432
  """
320
- Import an OTIO file to enter frame_in / frame_out / nb_frames (it can
321
- be every adapter supported by OpenTimelineIO, for example: edl, otio...
322
- ).
433
+ Import episode otio
323
434
  ---
324
435
  tags:
325
436
  - Import
437
+ description: Import an OTIO file to set frame_in, frame_out, and
438
+ nb_frames for shots in an episode. Supports any OpenTimelineIO
439
+ adapter format like EDL or OTIO. Uses naming convention with episode
440
+ name to match shots.
326
441
  consumes:
327
442
  - multipart/form-data
328
443
  parameters:
329
444
  - in: path
330
445
  name: project_id
331
- required: True
332
- type: string
333
- format: uuid
446
+ required: true
447
+ schema:
448
+ type: string
449
+ format: uuid
334
450
  example: a24a6ea4-ce75-4665-a070-57453082c25
335
451
  - in: path
336
452
  name: episode_id
337
- required: True
338
- type: string
339
- format: uuid
340
- example: a24a6ea4-ce75-4665-a070-57453082c25
453
+ required: true
454
+ schema:
455
+ type: string
456
+ format: uuid
457
+ example: b24a6ea4-ce75-4665-a070-57453082c25
458
+ - in: query
459
+ name: naming_convention
460
+ required: false
461
+ schema:
462
+ type: string
463
+ default: "${project_name}_${episode_name}-${sequence_name}-${shot_name}"
464
+ example: "${project_name}_${episode_name}-${sequence_name}-${shot_name}"
465
+ description: Template for matching shot names from the file
466
+ - in: query
467
+ name: match_case
468
+ required: false
469
+ schema:
470
+ type: boolean
471
+ default: true
472
+ example: true
473
+ description: Whether to match shot names case-sensitively
341
474
  - in: formData
342
475
  name: file
343
476
  type: file
344
477
  required: true
478
+ description: OTIO file to import (EDL, OTIO, etc.)
345
479
  responses:
346
480
  201:
347
- description: .
481
+ description: Shots imported successfully
482
+ content:
483
+ application/json:
484
+ schema:
485
+ type: object
486
+ properties:
487
+ updated_shots:
488
+ type: array
489
+ items:
490
+ type: object
491
+ properties:
492
+ id:
493
+ type: string
494
+ format: uuid
495
+ example: a24a6ea4-ce75-4665-a070-57453082c25
496
+ name:
497
+ type: string
498
+ example: SH010
499
+ project_id:
500
+ type: string
501
+ format: uuid
502
+ example: c24a6ea4-ce75-4665-a070-57453082c25
503
+ nb_frames:
504
+ type: integer
505
+ example: 120
506
+ data:
507
+ type: object
508
+ properties:
509
+ frame_in:
510
+ type: integer
511
+ example: 1001
512
+ frame_out:
513
+ type: integer
514
+ example: 1120
515
+ created_shots:
516
+ type: array
517
+ items:
518
+ type: object
519
+ properties:
520
+ id:
521
+ type: string
522
+ format: uuid
523
+ example: d24a6ea4-ce75-4665-a070-57453082c25
524
+ name:
525
+ type: string
526
+ example: SH020
527
+ project_id:
528
+ type: string
529
+ format: uuid
530
+ example: c24a6ea4-ce75-4665-a070-57453082c25
531
+ nb_frames:
532
+ type: integer
533
+ example: 96
534
+ data:
535
+ type: object
536
+ properties:
537
+ frame_in:
538
+ type: integer
539
+ example: 2001
540
+ frame_out:
541
+ type: integer
542
+ example: 2096
348
543
  400:
349
- description: The .otio file is not properly formatted.
544
+ description: Invalid file format or parsing error
350
545
  """
351
546
  return super().post(**kwargs)
352
547
 
@@ -1,4 +1,5 @@
1
1
  from flask import current_app
2
+ from flask_jwt_extended import jwt_required
2
3
 
3
4
  from sqlalchemy.exc import IntegrityError
4
5
 
@@ -26,6 +27,104 @@ class ImportShotgunAssetsResource(BaseImportShotgunResource):
26
27
  def __init__(self):
27
28
  BaseImportShotgunResource.__init__(self)
28
29
 
30
+ @jwt_required()
31
+ def post(self):
32
+ """
33
+ Import shotgun assets
34
+ ---
35
+ description: Import Shotgun assets. Send a list of Shotgun asset
36
+ entries in the JSON body. Returns created or updated assets with
37
+ parent-child relationships.
38
+ tags:
39
+ - Import
40
+ requestBody:
41
+ required: true
42
+ content:
43
+ application/json:
44
+ schema:
45
+ type: array
46
+ items:
47
+ type: object
48
+ properties:
49
+ id:
50
+ type: integer
51
+ description: Shotgun ID of the asset
52
+ example: 12345
53
+ code:
54
+ type: string
55
+ description: Asset code
56
+ example: "Asset01"
57
+ description:
58
+ type: string
59
+ description: Asset description
60
+ example: "Main character asset"
61
+ sg_asset_type:
62
+ type: string
63
+ description: Asset type name
64
+ example: "Character"
65
+ project:
66
+ type: object
67
+ description: Project information
68
+ properties:
69
+ id:
70
+ type: integer
71
+ example: 11111
72
+ parents:
73
+ type: array
74
+ description: Parent assets
75
+ items:
76
+ type: object
77
+ properties:
78
+ id:
79
+ type: integer
80
+ example: 22222
81
+ example:
82
+ - id: 12345
83
+ code: "Asset01"
84
+ description: "Main character asset"
85
+ sg_asset_type: "Character"
86
+ project:
87
+ id: 11111
88
+ parents:
89
+ - id: 22222
90
+ responses:
91
+ 200:
92
+ description: Assets imported successfully
93
+ content:
94
+ application/json:
95
+ schema:
96
+ type: array
97
+ items:
98
+ type: object
99
+ properties:
100
+ id:
101
+ type: string
102
+ format: uuid
103
+ description: Asset unique identifier
104
+ example: a24a6ea4-ce75-4665-a070-57453082c25
105
+ name:
106
+ type: string
107
+ description: Asset name
108
+ example: "Asset01"
109
+ description:
110
+ type: string
111
+ description: Asset description
112
+ example: "Main character asset"
113
+ created_at:
114
+ type: string
115
+ format: date-time
116
+ description: Creation timestamp
117
+ example: "2024-01-15T10:30:00Z"
118
+ updated_at:
119
+ type: string
120
+ format: date-time
121
+ description: Update timestamp
122
+ example: "2024-01-15T11:00:00Z"
123
+ 400:
124
+ description: Invalid request body or data format error
125
+ """
126
+ return super().post()
127
+
29
128
  def prepare_import(self):
30
129
  entity_type_names = self.extract_entity_type_names(self.sg_entries)
31
130
  assets_service.create_asset_types(entity_type_names)
@@ -120,6 +219,53 @@ class ImportRemoveShotgunAssetResource(ImportRemoveShotgunBaseResource):
120
219
  self, Entity, self.delete_func
121
220
  )
122
221
 
222
+ @jwt_required()
223
+ def post(self):
224
+ """
225
+ Remove shotgun asset
226
+ ---
227
+ description: Remove a Shotgun asset from the database. Provide the
228
+ Shotgun entry ID in the JSON body. If the asset has working files
229
+ linked to tasks, it will be cancelled instead of deleted.
230
+ tags:
231
+ - Import
232
+ requestBody:
233
+ required: true
234
+ content:
235
+ application/json:
236
+ schema:
237
+ type: object
238
+ required:
239
+ - id
240
+ properties:
241
+ id:
242
+ type: integer
243
+ description: Shotgun ID of the asset to remove
244
+ example: 12345
245
+ example:
246
+ id: 12345
247
+ responses:
248
+ 200:
249
+ description: Removal result returned
250
+ content:
251
+ application/json:
252
+ schema:
253
+ type: object
254
+ properties:
255
+ success:
256
+ type: boolean
257
+ description: Whether the removal was successful
258
+ example: true
259
+ removed_instance_id:
260
+ type: string
261
+ format: uuid
262
+ description: ID of the removed asset, if found
263
+ example: a24a6ea4-ce75-4665-a070-57453082c25
264
+ 400:
265
+ description: Invalid request body or instance not found
266
+ """
267
+ return super().post()
268
+
123
269
  def delete_func(self, asset):
124
270
  try:
125
271
  asset = assets_service.get_asset_by_shotgun_id(asset.shotgun_id)
@@ -28,24 +28,62 @@ class BaseImportShotgunResource(Resource):
28
28
  @jwt_required()
29
29
  def post(self):
30
30
  """
31
- Import shotgun resource.
31
+ Import shotgun resource
32
32
  ---
33
33
  tags:
34
34
  - Import
35
- parameters:
36
- - in: body
37
- name: sg_entries
38
- required: True
39
- schema:
35
+ description: Import Shotgun resources. Send a list of Shotgun entries
36
+ in the JSON body. Returns created or updated resources.
37
+ requestBody:
38
+ required: true
39
+ content:
40
+ application/json:
41
+ schema:
40
42
  type: array
41
43
  items:
42
- type: object
43
- properties:
44
- id:
45
- type: string
44
+ type: object
45
+ properties:
46
+ id:
47
+ type: integer
48
+ example: 12345
49
+ description: Shotgun ID of the entry
50
+ code:
51
+ type: string
52
+ example: SH010
53
+ name:
54
+ type: string
55
+ example: Shot name
56
+ example:
57
+ - id: 12345
58
+ code: SH010
59
+ name: Shot name
46
60
  responses:
47
61
  200:
48
- description: Resource imported
62
+ description: Resources imported successfully
63
+ content:
64
+ application/json:
65
+ schema:
66
+ type: array
67
+ items:
68
+ type: object
69
+ properties:
70
+ id:
71
+ type: string
72
+ format: uuid
73
+ example: a24a6ea4-ce75-4665-a070-57453082c25
74
+ name:
75
+ type: string
76
+ example: Imported resource
77
+ created_at:
78
+ type: string
79
+ format: date-time
80
+ example: "2024-01-15T10:30:00Z"
81
+ updated_at:
82
+ type: string
83
+ format: date-time
84
+ example: "2024-01-15T11:00:00Z"
85
+ 400:
86
+ description: Invalid request body or data format error
49
87
  """
50
88
  results = []
51
89
  self.sg_entries = request.json
@@ -169,13 +207,46 @@ class ImportRemoveShotgunBaseResource(Resource):
169
207
  @jwt_required()
170
208
  def post(self):
171
209
  """
172
- Import remove instance.
210
+ Remove shotgun resource
173
211
  ---
174
212
  tags:
175
213
  - Import
214
+ description: Remove a Shotgun resource from the database. Provide the
215
+ Shotgun entry ID in the JSON body.
216
+ requestBody:
217
+ required: true
218
+ content:
219
+ application/json:
220
+ schema:
221
+ type: object
222
+ required:
223
+ - id
224
+ properties:
225
+ id:
226
+ type: integer
227
+ example: 12345
228
+ description: Shotgun ID of the entry to remove
229
+ example:
230
+ id: 12345
176
231
  responses:
177
- 204:
178
- description: Instance removed
232
+ 200:
233
+ description: Removal result returned
234
+ content:
235
+ application/json:
236
+ schema:
237
+ type: object
238
+ properties:
239
+ success:
240
+ type: boolean
241
+ example: true
242
+ description: Whether the removal was successful
243
+ removed_instance_id:
244
+ type: string
245
+ format: uuid
246
+ example: a24a6ea4-ce75-4665-a070-57453082c25
247
+ description: ID of the removed instance, if found
248
+ 400:
249
+ description: Invalid request body or instance not found
179
250
  """
180
251
  sg_model = request.json
181
252
  instance = self.get_instance(sg_model)