zou 0.20.83__py3-none-any.whl → 0.20.85__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.85.dist-info}/METADATA +18 -18
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/RECORD +103 -102
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/WHEEL +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/entry_points.txt +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.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.schedule_item import ScheduleItem
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
@@ -10,6 +12,151 @@ class ScheduleItemsResource(BaseModelsResource):
|
|
|
10
12
|
def __init__(self):
|
|
11
13
|
BaseModelsResource.__init__(self, ScheduleItem)
|
|
12
14
|
|
|
15
|
+
@jwt_required()
|
|
16
|
+
def get(self):
|
|
17
|
+
"""
|
|
18
|
+
Get schedule items
|
|
19
|
+
---
|
|
20
|
+
tags:
|
|
21
|
+
- Crud
|
|
22
|
+
description: Retrieve all schedule items. Supports filtering via
|
|
23
|
+
query parameters and pagination.
|
|
24
|
+
parameters:
|
|
25
|
+
- in: query
|
|
26
|
+
name: page
|
|
27
|
+
required: false
|
|
28
|
+
schema:
|
|
29
|
+
type: integer
|
|
30
|
+
example: 1
|
|
31
|
+
description: Page number for pagination
|
|
32
|
+
- in: query
|
|
33
|
+
name: limit
|
|
34
|
+
required: false
|
|
35
|
+
schema:
|
|
36
|
+
type: integer
|
|
37
|
+
example: 50
|
|
38
|
+
description: Number of results per page
|
|
39
|
+
- in: query
|
|
40
|
+
name: relations
|
|
41
|
+
required: false
|
|
42
|
+
schema:
|
|
43
|
+
type: boolean
|
|
44
|
+
default: false
|
|
45
|
+
example: false
|
|
46
|
+
description: Whether to include relations
|
|
47
|
+
responses:
|
|
48
|
+
200:
|
|
49
|
+
description: Schedule items retrieved successfully
|
|
50
|
+
content:
|
|
51
|
+
application/json:
|
|
52
|
+
schema:
|
|
53
|
+
oneOf:
|
|
54
|
+
- type: array
|
|
55
|
+
items:
|
|
56
|
+
type: object
|
|
57
|
+
- type: object
|
|
58
|
+
properties:
|
|
59
|
+
data:
|
|
60
|
+
type: array
|
|
61
|
+
items:
|
|
62
|
+
type: object
|
|
63
|
+
example: []
|
|
64
|
+
total:
|
|
65
|
+
type: integer
|
|
66
|
+
example: 100
|
|
67
|
+
nb_pages:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 2
|
|
70
|
+
limit:
|
|
71
|
+
type: integer
|
|
72
|
+
example: 50
|
|
73
|
+
offset:
|
|
74
|
+
type: integer
|
|
75
|
+
example: 0
|
|
76
|
+
page:
|
|
77
|
+
type: integer
|
|
78
|
+
example: 1
|
|
79
|
+
400:
|
|
80
|
+
description: Invalid filter format or query error
|
|
81
|
+
"""
|
|
82
|
+
return super().get()
|
|
83
|
+
|
|
84
|
+
@jwt_required()
|
|
85
|
+
def post(self):
|
|
86
|
+
"""
|
|
87
|
+
Create schedule item
|
|
88
|
+
---
|
|
89
|
+
tags:
|
|
90
|
+
- Crud
|
|
91
|
+
description: Create a new schedule item with data provided in
|
|
92
|
+
the request body. JSON format is expected. Similar schedule
|
|
93
|
+
items cannot exist with same project, task type, and object.
|
|
94
|
+
requestBody:
|
|
95
|
+
required: true
|
|
96
|
+
content:
|
|
97
|
+
application/json:
|
|
98
|
+
schema:
|
|
99
|
+
type: object
|
|
100
|
+
required:
|
|
101
|
+
- project_id
|
|
102
|
+
- task_type_id
|
|
103
|
+
- object_id
|
|
104
|
+
properties:
|
|
105
|
+
project_id:
|
|
106
|
+
type: string
|
|
107
|
+
format: uuid
|
|
108
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
109
|
+
task_type_id:
|
|
110
|
+
type: string
|
|
111
|
+
format: uuid
|
|
112
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
113
|
+
object_id:
|
|
114
|
+
type: string
|
|
115
|
+
format: uuid
|
|
116
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
117
|
+
man_days:
|
|
118
|
+
type: number
|
|
119
|
+
example: 10.5
|
|
120
|
+
responses:
|
|
121
|
+
201:
|
|
122
|
+
description: Schedule item created successfully
|
|
123
|
+
content:
|
|
124
|
+
application/json:
|
|
125
|
+
schema:
|
|
126
|
+
type: object
|
|
127
|
+
properties:
|
|
128
|
+
id:
|
|
129
|
+
type: string
|
|
130
|
+
format: uuid
|
|
131
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
132
|
+
project_id:
|
|
133
|
+
type: string
|
|
134
|
+
format: uuid
|
|
135
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
136
|
+
task_type_id:
|
|
137
|
+
type: string
|
|
138
|
+
format: uuid
|
|
139
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
140
|
+
object_id:
|
|
141
|
+
type: string
|
|
142
|
+
format: uuid
|
|
143
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
144
|
+
man_days:
|
|
145
|
+
type: number
|
|
146
|
+
example: 10.5
|
|
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 similar schedule item exists
|
|
157
|
+
"""
|
|
158
|
+
return super().post()
|
|
159
|
+
|
|
13
160
|
def check_creation_integrity(self, data):
|
|
14
161
|
schedule_item = ScheduleItem.get_by(
|
|
15
162
|
project_id=data.get("project_id", None),
|
|
@@ -32,6 +179,164 @@ class ScheduleItemResource(BaseModelResource):
|
|
|
32
179
|
instance["project_id"], instance["task_type_id"]
|
|
33
180
|
)
|
|
34
181
|
|
|
182
|
+
@jwt_required()
|
|
183
|
+
def get(self, instance_id):
|
|
184
|
+
"""
|
|
185
|
+
Get schedule item
|
|
186
|
+
---
|
|
187
|
+
tags:
|
|
188
|
+
- Crud
|
|
189
|
+
description: Retrieve a schedule item by its ID and return it as
|
|
190
|
+
a JSON object. Supports including relations.
|
|
191
|
+
parameters:
|
|
192
|
+
- in: path
|
|
193
|
+
name: instance_id
|
|
194
|
+
required: true
|
|
195
|
+
schema:
|
|
196
|
+
type: string
|
|
197
|
+
format: uuid
|
|
198
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
199
|
+
- in: query
|
|
200
|
+
name: relations
|
|
201
|
+
required: false
|
|
202
|
+
schema:
|
|
203
|
+
type: boolean
|
|
204
|
+
default: true
|
|
205
|
+
example: true
|
|
206
|
+
description: Whether to include relations
|
|
207
|
+
responses:
|
|
208
|
+
200:
|
|
209
|
+
description: Schedule item retrieved successfully
|
|
210
|
+
content:
|
|
211
|
+
application/json:
|
|
212
|
+
schema:
|
|
213
|
+
type: object
|
|
214
|
+
properties:
|
|
215
|
+
id:
|
|
216
|
+
type: string
|
|
217
|
+
format: uuid
|
|
218
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
219
|
+
project_id:
|
|
220
|
+
type: string
|
|
221
|
+
format: uuid
|
|
222
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
223
|
+
task_type_id:
|
|
224
|
+
type: string
|
|
225
|
+
format: uuid
|
|
226
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
227
|
+
object_id:
|
|
228
|
+
type: string
|
|
229
|
+
format: uuid
|
|
230
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
231
|
+
man_days:
|
|
232
|
+
type: number
|
|
233
|
+
example: 10.5
|
|
234
|
+
created_at:
|
|
235
|
+
type: string
|
|
236
|
+
format: date-time
|
|
237
|
+
example: "2024-01-15T10:30:00Z"
|
|
238
|
+
updated_at:
|
|
239
|
+
type: string
|
|
240
|
+
format: date-time
|
|
241
|
+
example: "2024-01-15T10:30:00Z"
|
|
242
|
+
400:
|
|
243
|
+
description: Invalid ID format or query error
|
|
244
|
+
"""
|
|
245
|
+
return super().get(instance_id)
|
|
246
|
+
|
|
247
|
+
@jwt_required()
|
|
248
|
+
def put(self, instance_id):
|
|
249
|
+
"""
|
|
250
|
+
Update schedule item
|
|
251
|
+
---
|
|
252
|
+
tags:
|
|
253
|
+
- Crud
|
|
254
|
+
description: Update a schedule item with data provided in the
|
|
255
|
+
request body. JSON format is expected. Requires supervisor
|
|
256
|
+
access to project and task type.
|
|
257
|
+
parameters:
|
|
258
|
+
- in: path
|
|
259
|
+
name: instance_id
|
|
260
|
+
required: true
|
|
261
|
+
schema:
|
|
262
|
+
type: string
|
|
263
|
+
format: uuid
|
|
264
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
265
|
+
requestBody:
|
|
266
|
+
required: true
|
|
267
|
+
content:
|
|
268
|
+
application/json:
|
|
269
|
+
schema:
|
|
270
|
+
type: object
|
|
271
|
+
properties:
|
|
272
|
+
man_days:
|
|
273
|
+
type: number
|
|
274
|
+
example: 12.0
|
|
275
|
+
responses:
|
|
276
|
+
200:
|
|
277
|
+
description: Schedule item updated successfully
|
|
278
|
+
content:
|
|
279
|
+
application/json:
|
|
280
|
+
schema:
|
|
281
|
+
type: object
|
|
282
|
+
properties:
|
|
283
|
+
id:
|
|
284
|
+
type: string
|
|
285
|
+
format: uuid
|
|
286
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
287
|
+
project_id:
|
|
288
|
+
type: string
|
|
289
|
+
format: uuid
|
|
290
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
291
|
+
task_type_id:
|
|
292
|
+
type: string
|
|
293
|
+
format: uuid
|
|
294
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
295
|
+
object_id:
|
|
296
|
+
type: string
|
|
297
|
+
format: uuid
|
|
298
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
299
|
+
man_days:
|
|
300
|
+
type: number
|
|
301
|
+
example: 12.0
|
|
302
|
+
created_at:
|
|
303
|
+
type: string
|
|
304
|
+
format: date-time
|
|
305
|
+
example: "2024-01-15T10:30:00Z"
|
|
306
|
+
updated_at:
|
|
307
|
+
type: string
|
|
308
|
+
format: date-time
|
|
309
|
+
example: "2024-01-15T11:00:00Z"
|
|
310
|
+
400:
|
|
311
|
+
description: Invalid data format or validation error
|
|
312
|
+
"""
|
|
313
|
+
return super().put(instance_id)
|
|
314
|
+
|
|
315
|
+
@jwt_required()
|
|
316
|
+
def delete(self, instance_id):
|
|
317
|
+
"""
|
|
318
|
+
Delete schedule item
|
|
319
|
+
---
|
|
320
|
+
tags:
|
|
321
|
+
- Crud
|
|
322
|
+
description: Delete a schedule item by its ID. Returns empty
|
|
323
|
+
response on success.
|
|
324
|
+
parameters:
|
|
325
|
+
- in: path
|
|
326
|
+
name: instance_id
|
|
327
|
+
required: true
|
|
328
|
+
schema:
|
|
329
|
+
type: string
|
|
330
|
+
format: uuid
|
|
331
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
332
|
+
responses:
|
|
333
|
+
204:
|
|
334
|
+
description: Schedule item deleted successfully
|
|
335
|
+
400:
|
|
336
|
+
description: Integrity error or cannot delete
|
|
337
|
+
"""
|
|
338
|
+
return super().delete(instance_id)
|
|
339
|
+
|
|
35
340
|
def update_data(self, data, instance_id):
|
|
36
341
|
data = super().update_data(data, instance_id)
|
|
37
342
|
if isinstance(data.get("man_days", None), str):
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.search_filter import SearchFilter
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
@@ -7,7 +9,307 @@ class SearchFiltersResource(BaseModelsResource):
|
|
|
7
9
|
def __init__(self):
|
|
8
10
|
BaseModelsResource.__init__(self, SearchFilter)
|
|
9
11
|
|
|
12
|
+
@jwt_required()
|
|
13
|
+
def get(self):
|
|
14
|
+
"""
|
|
15
|
+
Get search filters
|
|
16
|
+
---
|
|
17
|
+
tags:
|
|
18
|
+
- Crud
|
|
19
|
+
description: Retrieve all search filters. Supports filtering via
|
|
20
|
+
query parameters and pagination.
|
|
21
|
+
parameters:
|
|
22
|
+
- in: query
|
|
23
|
+
name: page
|
|
24
|
+
required: false
|
|
25
|
+
schema:
|
|
26
|
+
type: integer
|
|
27
|
+
example: 1
|
|
28
|
+
description: Page number for pagination
|
|
29
|
+
- in: query
|
|
30
|
+
name: limit
|
|
31
|
+
required: false
|
|
32
|
+
schema:
|
|
33
|
+
type: integer
|
|
34
|
+
example: 50
|
|
35
|
+
description: Number of results per page
|
|
36
|
+
- in: query
|
|
37
|
+
name: relations
|
|
38
|
+
required: false
|
|
39
|
+
schema:
|
|
40
|
+
type: boolean
|
|
41
|
+
default: false
|
|
42
|
+
example: false
|
|
43
|
+
description: Whether to include relations
|
|
44
|
+
responses:
|
|
45
|
+
200:
|
|
46
|
+
description: Search filters retrieved successfully
|
|
47
|
+
content:
|
|
48
|
+
application/json:
|
|
49
|
+
schema:
|
|
50
|
+
oneOf:
|
|
51
|
+
- type: array
|
|
52
|
+
items:
|
|
53
|
+
type: object
|
|
54
|
+
- type: object
|
|
55
|
+
properties:
|
|
56
|
+
data:
|
|
57
|
+
type: array
|
|
58
|
+
items:
|
|
59
|
+
type: object
|
|
60
|
+
example: []
|
|
61
|
+
total:
|
|
62
|
+
type: integer
|
|
63
|
+
example: 100
|
|
64
|
+
nb_pages:
|
|
65
|
+
type: integer
|
|
66
|
+
example: 2
|
|
67
|
+
limit:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 50
|
|
70
|
+
offset:
|
|
71
|
+
type: integer
|
|
72
|
+
example: 0
|
|
73
|
+
page:
|
|
74
|
+
type: integer
|
|
75
|
+
example: 1
|
|
76
|
+
400:
|
|
77
|
+
description: Invalid filter format or query error
|
|
78
|
+
"""
|
|
79
|
+
return super().get()
|
|
80
|
+
|
|
81
|
+
@jwt_required()
|
|
82
|
+
def post(self):
|
|
83
|
+
"""
|
|
84
|
+
Create search filter
|
|
85
|
+
---
|
|
86
|
+
tags:
|
|
87
|
+
- Crud
|
|
88
|
+
description: Create a new search filter with data provided in
|
|
89
|
+
the request body. JSON format is expected.
|
|
90
|
+
requestBody:
|
|
91
|
+
required: true
|
|
92
|
+
content:
|
|
93
|
+
application/json:
|
|
94
|
+
schema:
|
|
95
|
+
type: object
|
|
96
|
+
required:
|
|
97
|
+
- name
|
|
98
|
+
- person_id
|
|
99
|
+
- search_filter_group_id
|
|
100
|
+
properties:
|
|
101
|
+
name:
|
|
102
|
+
type: string
|
|
103
|
+
example: My Filter
|
|
104
|
+
person_id:
|
|
105
|
+
type: string
|
|
106
|
+
format: uuid
|
|
107
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
108
|
+
search_filter_group_id:
|
|
109
|
+
type: string
|
|
110
|
+
format: uuid
|
|
111
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
112
|
+
list_type:
|
|
113
|
+
type: string
|
|
114
|
+
example: assets
|
|
115
|
+
responses:
|
|
116
|
+
201:
|
|
117
|
+
description: Search filter created successfully
|
|
118
|
+
content:
|
|
119
|
+
application/json:
|
|
120
|
+
schema:
|
|
121
|
+
type: object
|
|
122
|
+
properties:
|
|
123
|
+
id:
|
|
124
|
+
type: string
|
|
125
|
+
format: uuid
|
|
126
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
127
|
+
name:
|
|
128
|
+
type: string
|
|
129
|
+
example: My Filter
|
|
130
|
+
person_id:
|
|
131
|
+
type: string
|
|
132
|
+
format: uuid
|
|
133
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
134
|
+
search_filter_group_id:
|
|
135
|
+
type: string
|
|
136
|
+
format: uuid
|
|
137
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
138
|
+
list_type:
|
|
139
|
+
type: string
|
|
140
|
+
example: assets
|
|
141
|
+
created_at:
|
|
142
|
+
type: string
|
|
143
|
+
format: date-time
|
|
144
|
+
example: "2024-01-15T10:30:00Z"
|
|
145
|
+
updated_at:
|
|
146
|
+
type: string
|
|
147
|
+
format: date-time
|
|
148
|
+
example: "2024-01-15T10:30:00Z"
|
|
149
|
+
400:
|
|
150
|
+
description: Invalid data format or validation error
|
|
151
|
+
"""
|
|
152
|
+
return super().post()
|
|
153
|
+
|
|
10
154
|
|
|
11
155
|
class SearchFilterResource(BaseModelResource):
|
|
12
156
|
def __init__(self):
|
|
13
157
|
BaseModelResource.__init__(self, SearchFilter)
|
|
158
|
+
|
|
159
|
+
@jwt_required()
|
|
160
|
+
def get(self, instance_id):
|
|
161
|
+
"""
|
|
162
|
+
Get search filter
|
|
163
|
+
---
|
|
164
|
+
tags:
|
|
165
|
+
- Crud
|
|
166
|
+
description: Retrieve a search filter by its ID and return it
|
|
167
|
+
as a JSON object. Supports including relations.
|
|
168
|
+
parameters:
|
|
169
|
+
- in: path
|
|
170
|
+
name: instance_id
|
|
171
|
+
required: true
|
|
172
|
+
schema:
|
|
173
|
+
type: string
|
|
174
|
+
format: uuid
|
|
175
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
176
|
+
- in: query
|
|
177
|
+
name: relations
|
|
178
|
+
required: false
|
|
179
|
+
schema:
|
|
180
|
+
type: boolean
|
|
181
|
+
default: true
|
|
182
|
+
example: true
|
|
183
|
+
description: Whether to include relations
|
|
184
|
+
responses:
|
|
185
|
+
200:
|
|
186
|
+
description: Search filter retrieved successfully
|
|
187
|
+
content:
|
|
188
|
+
application/json:
|
|
189
|
+
schema:
|
|
190
|
+
type: object
|
|
191
|
+
properties:
|
|
192
|
+
id:
|
|
193
|
+
type: string
|
|
194
|
+
format: uuid
|
|
195
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
196
|
+
name:
|
|
197
|
+
type: string
|
|
198
|
+
example: My Filter
|
|
199
|
+
person_id:
|
|
200
|
+
type: string
|
|
201
|
+
format: uuid
|
|
202
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
203
|
+
search_filter_group_id:
|
|
204
|
+
type: string
|
|
205
|
+
format: uuid
|
|
206
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
207
|
+
list_type:
|
|
208
|
+
type: string
|
|
209
|
+
example: assets
|
|
210
|
+
created_at:
|
|
211
|
+
type: string
|
|
212
|
+
format: date-time
|
|
213
|
+
example: "2024-01-15T10:30:00Z"
|
|
214
|
+
updated_at:
|
|
215
|
+
type: string
|
|
216
|
+
format: date-time
|
|
217
|
+
example: "2024-01-15T10:30:00Z"
|
|
218
|
+
400:
|
|
219
|
+
description: Invalid ID format or query error
|
|
220
|
+
"""
|
|
221
|
+
return super().get(instance_id)
|
|
222
|
+
|
|
223
|
+
@jwt_required()
|
|
224
|
+
def put(self, instance_id):
|
|
225
|
+
"""
|
|
226
|
+
Update search filter
|
|
227
|
+
---
|
|
228
|
+
tags:
|
|
229
|
+
- Crud
|
|
230
|
+
description: Update a search filter with data provided in the
|
|
231
|
+
request body. JSON format is expected.
|
|
232
|
+
parameters:
|
|
233
|
+
- in: path
|
|
234
|
+
name: instance_id
|
|
235
|
+
required: true
|
|
236
|
+
schema:
|
|
237
|
+
type: string
|
|
238
|
+
format: uuid
|
|
239
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
240
|
+
requestBody:
|
|
241
|
+
required: true
|
|
242
|
+
content:
|
|
243
|
+
application/json:
|
|
244
|
+
schema:
|
|
245
|
+
type: object
|
|
246
|
+
properties:
|
|
247
|
+
name:
|
|
248
|
+
type: string
|
|
249
|
+
example: Updated Filter Name
|
|
250
|
+
list_type:
|
|
251
|
+
type: string
|
|
252
|
+
example: shots
|
|
253
|
+
responses:
|
|
254
|
+
200:
|
|
255
|
+
description: Search filter updated successfully
|
|
256
|
+
content:
|
|
257
|
+
application/json:
|
|
258
|
+
schema:
|
|
259
|
+
type: object
|
|
260
|
+
properties:
|
|
261
|
+
id:
|
|
262
|
+
type: string
|
|
263
|
+
format: uuid
|
|
264
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
265
|
+
name:
|
|
266
|
+
type: string
|
|
267
|
+
example: Updated Filter Name
|
|
268
|
+
person_id:
|
|
269
|
+
type: string
|
|
270
|
+
format: uuid
|
|
271
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
272
|
+
search_filter_group_id:
|
|
273
|
+
type: string
|
|
274
|
+
format: uuid
|
|
275
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
276
|
+
list_type:
|
|
277
|
+
type: string
|
|
278
|
+
example: shots
|
|
279
|
+
created_at:
|
|
280
|
+
type: string
|
|
281
|
+
format: date-time
|
|
282
|
+
example: "2024-01-15T10:30:00Z"
|
|
283
|
+
updated_at:
|
|
284
|
+
type: string
|
|
285
|
+
format: date-time
|
|
286
|
+
example: "2024-01-15T11:00:00Z"
|
|
287
|
+
400:
|
|
288
|
+
description: Invalid data format or validation error
|
|
289
|
+
"""
|
|
290
|
+
return super().put(instance_id)
|
|
291
|
+
|
|
292
|
+
@jwt_required()
|
|
293
|
+
def delete(self, instance_id):
|
|
294
|
+
"""
|
|
295
|
+
Delete search filter
|
|
296
|
+
---
|
|
297
|
+
tags:
|
|
298
|
+
- Crud
|
|
299
|
+
description: Delete a search filter by its ID. Returns empty
|
|
300
|
+
response on success.
|
|
301
|
+
parameters:
|
|
302
|
+
- in: path
|
|
303
|
+
name: instance_id
|
|
304
|
+
required: true
|
|
305
|
+
schema:
|
|
306
|
+
type: string
|
|
307
|
+
format: uuid
|
|
308
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
309
|
+
responses:
|
|
310
|
+
204:
|
|
311
|
+
description: Search filter deleted successfully
|
|
312
|
+
400:
|
|
313
|
+
description: Integrity error or cannot delete
|
|
314
|
+
"""
|
|
315
|
+
return super().delete(instance_id)
|