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.
Files changed (114) hide show
  1. zou/__init__.py +1 -1
  2. zou/app/blueprints/assets/resources.py +1060 -153
  3. zou/app/blueprints/auth/resources.py +368 -238
  4. zou/app/blueprints/breakdown/resources.py +584 -94
  5. zou/app/blueprints/chats/resources.py +176 -37
  6. zou/app/blueprints/comments/resources.py +409 -150
  7. zou/app/blueprints/concepts/resources.py +443 -63
  8. zou/app/blueprints/crud/asset_instance.py +272 -0
  9. zou/app/blueprints/crud/attachment_file.py +263 -0
  10. zou/app/blueprints/crud/base.py +176 -69
  11. zou/app/blueprints/crud/budget.py +278 -0
  12. zou/app/blueprints/crud/budget_entry.py +269 -0
  13. zou/app/blueprints/crud/chat.py +282 -0
  14. zou/app/blueprints/crud/chat_message.py +286 -0
  15. zou/app/blueprints/crud/comments.py +312 -1
  16. zou/app/blueprints/crud/custom_action.py +268 -0
  17. zou/app/blueprints/crud/day_off.py +298 -0
  18. zou/app/blueprints/crud/department.py +268 -0
  19. zou/app/blueprints/crud/entity.py +297 -3
  20. zou/app/blueprints/crud/entity_link.py +303 -0
  21. zou/app/blueprints/crud/entity_type.py +269 -0
  22. zou/app/blueprints/crud/event.py +197 -0
  23. zou/app/blueprints/crud/file_status.py +268 -0
  24. zou/app/blueprints/crud/hardware_item.py +268 -0
  25. zou/app/blueprints/crud/metadata_descriptor.py +312 -0
  26. zou/app/blueprints/crud/milestone.py +302 -1
  27. zou/app/blueprints/crud/news.py +285 -0
  28. zou/app/blueprints/crud/notification.py +287 -0
  29. zou/app/blueprints/crud/organisation.py +269 -0
  30. zou/app/blueprints/crud/output_file.py +34 -10
  31. zou/app/blueprints/crud/output_type.py +30 -10
  32. zou/app/blueprints/crud/person.py +407 -2
  33. zou/app/blueprints/crud/playlist.py +322 -4
  34. zou/app/blueprints/crud/plugin.py +269 -0
  35. zou/app/blueprints/crud/preview_background_file.py +272 -0
  36. zou/app/blueprints/crud/preview_file.py +280 -9
  37. zou/app/blueprints/crud/production_schedule_version.py +569 -0
  38. zou/app/blueprints/crud/project.py +440 -0
  39. zou/app/blueprints/crud/project_status.py +268 -0
  40. zou/app/blueprints/crud/salary_scale.py +185 -5
  41. zou/app/blueprints/crud/schedule_item.py +305 -0
  42. zou/app/blueprints/crud/search_filter.py +302 -0
  43. zou/app/blueprints/crud/search_filter_group.py +270 -0
  44. zou/app/blueprints/crud/software.py +30 -10
  45. zou/app/blueprints/crud/status_automation.py +296 -2
  46. zou/app/blueprints/crud/studio.py +268 -0
  47. zou/app/blueprints/crud/subscription.py +279 -0
  48. zou/app/blueprints/crud/task.py +325 -5
  49. zou/app/blueprints/crud/task_status.py +301 -0
  50. zou/app/blueprints/crud/task_type.py +283 -0
  51. zou/app/blueprints/crud/time_spent.py +327 -0
  52. zou/app/blueprints/crud/working_file.py +273 -10
  53. zou/app/blueprints/departments/resources.py +302 -68
  54. zou/app/blueprints/edits/resources.py +651 -81
  55. zou/app/blueprints/entities/resources.py +104 -39
  56. zou/app/blueprints/events/resources.py +96 -8
  57. zou/app/blueprints/export/csv/assets.py +15 -5
  58. zou/app/blueprints/export/csv/base.py +12 -3
  59. zou/app/blueprints/export/csv/casting.py +32 -5
  60. zou/app/blueprints/export/csv/edits.py +15 -5
  61. zou/app/blueprints/export/csv/persons.py +24 -0
  62. zou/app/blueprints/export/csv/playlists.py +16 -5
  63. zou/app/blueprints/export/csv/projects.py +23 -0
  64. zou/app/blueprints/export/csv/shots.py +15 -5
  65. zou/app/blueprints/export/csv/task_types.py +23 -0
  66. zou/app/blueprints/export/csv/tasks.py +24 -0
  67. zou/app/blueprints/export/csv/time_spents.py +24 -0
  68. zou/app/blueprints/files/resources.py +928 -377
  69. zou/app/blueprints/index/resources.py +49 -42
  70. zou/app/blueprints/news/resources.py +47 -27
  71. zou/app/blueprints/persons/resources.py +644 -271
  72. zou/app/blueprints/playlists/resources.py +154 -72
  73. zou/app/blueprints/previews/resources.py +473 -228
  74. zou/app/blueprints/projects/__init__.py +5 -0
  75. zou/app/blueprints/projects/resources.py +987 -420
  76. zou/app/blueprints/search/resources.py +44 -32
  77. zou/app/blueprints/shots/resources.py +1338 -88
  78. zou/app/blueprints/source/csv/assets.py +44 -6
  79. zou/app/blueprints/source/csv/casting.py +43 -6
  80. zou/app/blueprints/source/csv/edits.py +47 -9
  81. zou/app/blueprints/source/csv/persons.py +43 -4
  82. zou/app/blueprints/source/csv/shots.py +47 -6
  83. zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
  84. zou/app/blueprints/source/kitsu.py +433 -11
  85. zou/app/blueprints/source/otio.py +215 -20
  86. zou/app/blueprints/source/shotgun/assets.py +146 -0
  87. zou/app/blueprints/source/shotgun/base.py +85 -14
  88. zou/app/blueprints/source/shotgun/episode.py +124 -0
  89. zou/app/blueprints/source/shotgun/import_errors.py +105 -14
  90. zou/app/blueprints/source/shotgun/notes.py +132 -0
  91. zou/app/blueprints/source/shotgun/person.py +163 -0
  92. zou/app/blueprints/source/shotgun/project.py +120 -0
  93. zou/app/blueprints/source/shotgun/scene.py +120 -0
  94. zou/app/blueprints/source/shotgun/sequence.py +134 -0
  95. zou/app/blueprints/source/shotgun/shot.py +166 -0
  96. zou/app/blueprints/source/shotgun/status.py +129 -0
  97. zou/app/blueprints/source/shotgun/steps.py +138 -0
  98. zou/app/blueprints/source/shotgun/tasks.py +199 -0
  99. zou/app/blueprints/source/shotgun/team.py +132 -0
  100. zou/app/blueprints/source/shotgun/versions.py +155 -0
  101. zou/app/blueprints/tasks/resources.py +1197 -308
  102. zou/app/blueprints/user/resources.py +1808 -215
  103. zou/app/models/metadata_descriptor.py +1 -0
  104. zou/app/services/persons_service.py +1 -1
  105. zou/app/services/projects_service.py +45 -1
  106. zou/app/services/time_spents_service.py +1 -1
  107. zou/app/swagger.py +100 -27
  108. zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
  109. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/METADATA +18 -18
  110. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/RECORD +114 -113
  111. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/WHEEL +0 -0
  112. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/entry_points.txt +0 -0
  113. {zou-0.20.82.dist-info → zou-0.20.84.dist-info}/licenses/LICENSE +0 -0
  114. {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.models.entity import EntityLink
2
4
  from zou.app.utils import fields
3
5
 
@@ -12,11 +14,312 @@ class EntityLinksResource(BaseModelsResource):
12
14
  def __init__(self):
13
15
  BaseModelsResource.__init__(self, EntityLink)
14
16
 
17
+ @jwt_required()
18
+ def get(self):
19
+ """
20
+ Get entity links
21
+ ---
22
+ tags:
23
+ - Crud
24
+ description: Retrieve all entity links. Supports filtering via
25
+ 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: Entity links 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 entity link
90
+ ---
91
+ tags:
92
+ - Crud
93
+ description: Create a new entity link with data provided in the
94
+ request body. JSON format is expected. Links entities together
95
+ in casting relationships.
96
+ requestBody:
97
+ required: true
98
+ content:
99
+ application/json:
100
+ schema:
101
+ type: object
102
+ required:
103
+ - entity_in_id
104
+ - entity_out_id
105
+ properties:
106
+ entity_in_id:
107
+ type: string
108
+ format: uuid
109
+ example: a24a6ea4-ce75-4665-a070-57453082c25
110
+ entity_out_id:
111
+ type: string
112
+ format: uuid
113
+ example: b24a6ea4-ce75-4665-a070-57453082c25
114
+ nb_occurences:
115
+ type: integer
116
+ default: 1
117
+ example: 1
118
+ label:
119
+ type: string
120
+ example: fixed
121
+ responses:
122
+ 201:
123
+ description: Entity link created successfully
124
+ content:
125
+ application/json:
126
+ schema:
127
+ type: object
128
+ properties:
129
+ id:
130
+ type: string
131
+ format: uuid
132
+ example: a24a6ea4-ce75-4665-a070-57453082c25
133
+ entity_in_id:
134
+ type: string
135
+ format: uuid
136
+ example: b24a6ea4-ce75-4665-a070-57453082c25
137
+ entity_out_id:
138
+ type: string
139
+ format: uuid
140
+ example: c24a6ea4-ce75-4665-a070-57453082c25
141
+ nb_occurences:
142
+ type: integer
143
+ example: 1
144
+ label:
145
+ type: string
146
+ example: fixed
147
+ created_at:
148
+ type: string
149
+ format: date-time
150
+ example: "2024-01-15T10:30:00Z"
151
+ updated_at:
152
+ type: string
153
+ format: date-time
154
+ example: "2024-01-15T10:30:00Z"
155
+ 400:
156
+ description: Invalid data format or validation error
157
+ """
158
+ return super().post()
159
+
15
160
 
16
161
  class EntityLinkResource(BaseModelResource):
17
162
  def __init__(self):
18
163
  BaseModelResource.__init__(self, EntityLink)
19
164
 
165
+ @jwt_required()
166
+ def get(self, instance_id):
167
+ """
168
+ Get entity link
169
+ ---
170
+ tags:
171
+ - Crud
172
+ description: Retrieve an entity link by its ID and return it as a
173
+ JSON object. Supports including relations.
174
+ parameters:
175
+ - in: path
176
+ name: instance_id
177
+ required: true
178
+ schema:
179
+ type: string
180
+ format: uuid
181
+ example: a24a6ea4-ce75-4665-a070-57453082c25
182
+ - in: query
183
+ name: relations
184
+ required: false
185
+ schema:
186
+ type: boolean
187
+ default: true
188
+ example: true
189
+ description: Whether to include relations
190
+ responses:
191
+ 200:
192
+ description: Entity link retrieved successfully
193
+ content:
194
+ application/json:
195
+ schema:
196
+ type: object
197
+ properties:
198
+ id:
199
+ type: string
200
+ format: uuid
201
+ example: a24a6ea4-ce75-4665-a070-57453082c25
202
+ entity_in_id:
203
+ type: string
204
+ format: uuid
205
+ example: b24a6ea4-ce75-4665-a070-57453082c25
206
+ entity_out_id:
207
+ type: string
208
+ format: uuid
209
+ example: c24a6ea4-ce75-4665-a070-57453082c25
210
+ nb_occurences:
211
+ type: integer
212
+ example: 1
213
+ label:
214
+ type: string
215
+ example: fixed
216
+ created_at:
217
+ type: string
218
+ format: date-time
219
+ example: "2024-01-15T10:30:00Z"
220
+ updated_at:
221
+ type: string
222
+ format: date-time
223
+ example: "2024-01-15T10:30:00Z"
224
+ 400:
225
+ description: Invalid ID format or query error
226
+ """
227
+ return super().get(instance_id)
228
+
229
+ @jwt_required()
230
+ def put(self, instance_id):
231
+ """
232
+ Update entity link
233
+ ---
234
+ tags:
235
+ - Crud
236
+ description: Update an entity link with data provided in the
237
+ request body. JSON format is expected.
238
+ parameters:
239
+ - in: path
240
+ name: instance_id
241
+ required: true
242
+ schema:
243
+ type: string
244
+ format: uuid
245
+ example: a24a6ea4-ce75-4665-a070-57453082c25
246
+ requestBody:
247
+ required: true
248
+ content:
249
+ application/json:
250
+ schema:
251
+ type: object
252
+ properties:
253
+ nb_occurences:
254
+ type: integer
255
+ example: 2
256
+ label:
257
+ type: string
258
+ example: updated
259
+ responses:
260
+ 200:
261
+ description: Entity link updated successfully
262
+ content:
263
+ application/json:
264
+ schema:
265
+ type: object
266
+ properties:
267
+ id:
268
+ type: string
269
+ format: uuid
270
+ example: a24a6ea4-ce75-4665-a070-57453082c25
271
+ entity_in_id:
272
+ type: string
273
+ format: uuid
274
+ example: b24a6ea4-ce75-4665-a070-57453082c25
275
+ entity_out_id:
276
+ type: string
277
+ format: uuid
278
+ example: c24a6ea4-ce75-4665-a070-57453082c25
279
+ nb_occurences:
280
+ type: integer
281
+ example: 2
282
+ label:
283
+ type: string
284
+ example: updated
285
+ created_at:
286
+ type: string
287
+ format: date-time
288
+ example: "2024-01-15T10:30:00Z"
289
+ updated_at:
290
+ type: string
291
+ format: date-time
292
+ example: "2024-01-15T11:00:00Z"
293
+ 400:
294
+ description: Invalid data format or validation error
295
+ """
296
+ return super().put(instance_id)
297
+
298
+ @jwt_required()
299
+ def delete(self, instance_id):
300
+ """
301
+ Delete entity link
302
+ ---
303
+ tags:
304
+ - Crud
305
+ description: Delete an entity link by its ID. Returns empty
306
+ response on success.
307
+ parameters:
308
+ - in: path
309
+ name: instance_id
310
+ required: true
311
+ schema:
312
+ type: string
313
+ format: uuid
314
+ example: a24a6ea4-ce75-4665-a070-57453082c25
315
+ responses:
316
+ 204:
317
+ description: Entity link deleted successfully
318
+ 400:
319
+ description: Integrity error or cannot delete
320
+ """
321
+ return super().delete(instance_id)
322
+
20
323
  def get_model_or_404(self, instance_id):
21
324
  if not fields.is_valid_id(instance_id):
22
325
  raise WrongParameterException("Malformed ID.")
@@ -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.entity_type import EntityType
@@ -11,6 +13,131 @@ class EntityTypesResource(BaseModelsResource):
11
13
  def __init__(self):
12
14
  BaseModelsResource.__init__(self, EntityType)
13
15
 
16
+ @jwt_required()
17
+ def get(self):
18
+ """
19
+ Get entity types
20
+ ---
21
+ tags:
22
+ - Crud
23
+ description: Retrieve all entity types. Supports filtering via query
24
+ parameters and pagination.
25
+ parameters:
26
+ - in: query
27
+ name: page
28
+ required: false
29
+ schema:
30
+ type: integer
31
+ example: 1
32
+ description: Page number for pagination
33
+ - in: query
34
+ name: limit
35
+ required: false
36
+ schema:
37
+ type: integer
38
+ example: 50
39
+ description: Number of results per page
40
+ - in: query
41
+ name: relations
42
+ required: false
43
+ schema:
44
+ type: boolean
45
+ default: false
46
+ example: false
47
+ description: Whether to include relations
48
+ responses:
49
+ 200:
50
+ description: Entity types retrieved successfully
51
+ content:
52
+ application/json:
53
+ schema:
54
+ oneOf:
55
+ - type: array
56
+ items:
57
+ type: object
58
+ - type: object
59
+ properties:
60
+ data:
61
+ type: array
62
+ items:
63
+ type: object
64
+ example: []
65
+ total:
66
+ type: integer
67
+ example: 100
68
+ nb_pages:
69
+ type: integer
70
+ example: 2
71
+ limit:
72
+ type: integer
73
+ example: 50
74
+ offset:
75
+ type: integer
76
+ example: 0
77
+ page:
78
+ type: integer
79
+ example: 1
80
+ 400:
81
+ description: Invalid filter format or query error
82
+ """
83
+ return super().get()
84
+
85
+ @jwt_required()
86
+ def post(self):
87
+ """
88
+ Create entity type
89
+ ---
90
+ tags:
91
+ - Crud
92
+ description: Create a new entity type with data provided in the
93
+ request body. JSON format is expected. Entity type names must
94
+ be unique.
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: Character
107
+ color:
108
+ type: string
109
+ example: "#FF5733"
110
+ responses:
111
+ 201:
112
+ description: Entity type 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: Character
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 entity type already exists
138
+ """
139
+ return super().post()
140
+
14
141
  def all_entries(self, query=None, relations=False):
15
142
  if query is None:
16
143
  query = self.model.query
@@ -48,6 +175,148 @@ class EntityTypeResource(BaseModelResource):
48
175
  def check_read_permissions(self, instance):
49
176
  return True
50
177
 
178
+ @jwt_required()
179
+ def get(self, instance_id):
180
+ """
181
+ Get entity type
182
+ ---
183
+ tags:
184
+ - Crud
185
+ description: Retrieve an entity type by its ID and return it as a
186
+ JSON object. Supports including relations.
187
+ parameters:
188
+ - in: path
189
+ name: instance_id
190
+ required: true
191
+ schema:
192
+ type: string
193
+ format: uuid
194
+ example: a24a6ea4-ce75-4665-a070-57453082c25
195
+ - in: query
196
+ name: relations
197
+ required: false
198
+ schema:
199
+ type: boolean
200
+ default: true
201
+ example: true
202
+ description: Whether to include relations
203
+ responses:
204
+ 200:
205
+ description: Entity type retrieved successfully
206
+ content:
207
+ application/json:
208
+ schema:
209
+ type: object
210
+ properties:
211
+ id:
212
+ type: string
213
+ format: uuid
214
+ example: a24a6ea4-ce75-4665-a070-57453082c25
215
+ name:
216
+ type: string
217
+ example: Character
218
+ color:
219
+ type: string
220
+ example: "#FF5733"
221
+ created_at:
222
+ type: string
223
+ format: date-time
224
+ example: "2024-01-15T10:30:00Z"
225
+ updated_at:
226
+ type: string
227
+ format: date-time
228
+ example: "2024-01-15T10:30:00Z"
229
+ 400:
230
+ description: Invalid ID format or query error
231
+ """
232
+ return super().get(instance_id)
233
+
234
+ @jwt_required()
235
+ def put(self, instance_id):
236
+ """
237
+ Update entity type
238
+ ---
239
+ tags:
240
+ - Crud
241
+ description: Update an entity type with data provided in the
242
+ request body. JSON format is expected.
243
+ parameters:
244
+ - in: path
245
+ name: instance_id
246
+ required: true
247
+ schema:
248
+ type: string
249
+ format: uuid
250
+ example: a24a6ea4-ce75-4665-a070-57453082c25
251
+ requestBody:
252
+ required: true
253
+ content:
254
+ application/json:
255
+ schema:
256
+ type: object
257
+ properties:
258
+ name:
259
+ type: string
260
+ example: Updated Character
261
+ color:
262
+ type: string
263
+ example: "#FF5734"
264
+ responses:
265
+ 200:
266
+ description: Entity type updated successfully
267
+ content:
268
+ application/json:
269
+ schema:
270
+ type: object
271
+ properties:
272
+ id:
273
+ type: string
274
+ format: uuid
275
+ example: a24a6ea4-ce75-4665-a070-57453082c25
276
+ name:
277
+ type: string
278
+ example: Updated Character
279
+ color:
280
+ type: string
281
+ example: "#FF5734"
282
+ created_at:
283
+ type: string
284
+ format: date-time
285
+ example: "2024-01-15T10:30:00Z"
286
+ updated_at:
287
+ type: string
288
+ format: date-time
289
+ example: "2024-01-15T11:00:00Z"
290
+ 400:
291
+ description: Invalid data format or validation error
292
+ """
293
+ return super().put(instance_id)
294
+
295
+ @jwt_required()
296
+ def delete(self, instance_id):
297
+ """
298
+ Delete entity type
299
+ ---
300
+ tags:
301
+ - Crud
302
+ description: Delete an entity type by its ID. Returns empty
303
+ response on success.
304
+ parameters:
305
+ - in: path
306
+ name: instance_id
307
+ required: true
308
+ schema:
309
+ type: string
310
+ format: uuid
311
+ example: a24a6ea4-ce75-4665-a070-57453082c25
312
+ responses:
313
+ 204:
314
+ description: Entity type deleted successfully
315
+ 400:
316
+ description: Integrity error or cannot delete
317
+ """
318
+ return super().delete(instance_id)
319
+
51
320
  def emit_update_event(self, instance_dict):
52
321
  events.emit(
53
322
  "asset-type:update", {"asset_type_id": instance_dict["id"]}