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.attachment_file import AttachmentFile
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
@@ -11,11 +13,272 @@ class AttachmentFilesResource(BaseModelsResource):
|
|
|
11
13
|
def __init__(self):
|
|
12
14
|
BaseModelsResource.__init__(self, AttachmentFile)
|
|
13
15
|
|
|
16
|
+
@jwt_required()
|
|
17
|
+
def get(self):
|
|
18
|
+
"""
|
|
19
|
+
Get attachment files
|
|
20
|
+
---
|
|
21
|
+
tags:
|
|
22
|
+
- Crud
|
|
23
|
+
description: Retrieve all attachment files. Supports filtering via
|
|
24
|
+
query 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: Attachment files 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 attachment file
|
|
89
|
+
---
|
|
90
|
+
tags:
|
|
91
|
+
- Crud
|
|
92
|
+
description: Create a new attachment file with data provided in the
|
|
93
|
+
request body. JSON format is expected.
|
|
94
|
+
requestBody:
|
|
95
|
+
required: true
|
|
96
|
+
content:
|
|
97
|
+
application/json:
|
|
98
|
+
schema:
|
|
99
|
+
type: object
|
|
100
|
+
properties:
|
|
101
|
+
name:
|
|
102
|
+
type: string
|
|
103
|
+
example: attachment.pdf
|
|
104
|
+
comment_id:
|
|
105
|
+
type: string
|
|
106
|
+
format: uuid
|
|
107
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
108
|
+
responses:
|
|
109
|
+
201:
|
|
110
|
+
description: Attachment file created successfully
|
|
111
|
+
content:
|
|
112
|
+
application/json:
|
|
113
|
+
schema:
|
|
114
|
+
type: object
|
|
115
|
+
properties:
|
|
116
|
+
id:
|
|
117
|
+
type: string
|
|
118
|
+
format: uuid
|
|
119
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
120
|
+
name:
|
|
121
|
+
type: string
|
|
122
|
+
example: attachment.pdf
|
|
123
|
+
comment_id:
|
|
124
|
+
type: string
|
|
125
|
+
format: uuid
|
|
126
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
127
|
+
created_at:
|
|
128
|
+
type: string
|
|
129
|
+
format: date-time
|
|
130
|
+
example: "2024-01-15T10:30:00Z"
|
|
131
|
+
updated_at:
|
|
132
|
+
type: string
|
|
133
|
+
format: date-time
|
|
134
|
+
example: "2024-01-15T10:30:00Z"
|
|
135
|
+
400:
|
|
136
|
+
description: Invalid data format or validation error
|
|
137
|
+
"""
|
|
138
|
+
return super().post()
|
|
139
|
+
|
|
14
140
|
|
|
15
141
|
class AttachmentFileResource(BaseModelResource):
|
|
16
142
|
def __init__(self):
|
|
17
143
|
BaseModelResource.__init__(self, AttachmentFile)
|
|
18
144
|
|
|
145
|
+
@jwt_required()
|
|
146
|
+
def get(self, instance_id):
|
|
147
|
+
"""
|
|
148
|
+
Get attachment file
|
|
149
|
+
---
|
|
150
|
+
tags:
|
|
151
|
+
- Crud
|
|
152
|
+
description: Retrieve an attachment file by its ID and return it
|
|
153
|
+
as a JSON object. Supports including relations.
|
|
154
|
+
parameters:
|
|
155
|
+
- in: path
|
|
156
|
+
name: instance_id
|
|
157
|
+
required: true
|
|
158
|
+
schema:
|
|
159
|
+
type: string
|
|
160
|
+
format: uuid
|
|
161
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
162
|
+
- in: query
|
|
163
|
+
name: relations
|
|
164
|
+
required: false
|
|
165
|
+
schema:
|
|
166
|
+
type: boolean
|
|
167
|
+
default: true
|
|
168
|
+
example: true
|
|
169
|
+
description: Whether to include relations
|
|
170
|
+
responses:
|
|
171
|
+
200:
|
|
172
|
+
description: Attachment file retrieved successfully
|
|
173
|
+
content:
|
|
174
|
+
application/json:
|
|
175
|
+
schema:
|
|
176
|
+
type: object
|
|
177
|
+
properties:
|
|
178
|
+
id:
|
|
179
|
+
type: string
|
|
180
|
+
format: uuid
|
|
181
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
182
|
+
name:
|
|
183
|
+
type: string
|
|
184
|
+
example: attachment.pdf
|
|
185
|
+
comment_id:
|
|
186
|
+
type: string
|
|
187
|
+
format: uuid
|
|
188
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
189
|
+
created_at:
|
|
190
|
+
type: string
|
|
191
|
+
format: date-time
|
|
192
|
+
example: "2024-01-15T10:30:00Z"
|
|
193
|
+
updated_at:
|
|
194
|
+
type: string
|
|
195
|
+
format: date-time
|
|
196
|
+
example: "2024-01-15T10:30:00Z"
|
|
197
|
+
400:
|
|
198
|
+
description: Invalid ID format or query error
|
|
199
|
+
"""
|
|
200
|
+
return super().get(instance_id)
|
|
201
|
+
|
|
202
|
+
@jwt_required()
|
|
203
|
+
def put(self, instance_id):
|
|
204
|
+
"""
|
|
205
|
+
Update attachment file
|
|
206
|
+
---
|
|
207
|
+
tags:
|
|
208
|
+
- Crud
|
|
209
|
+
description: Update an attachment file with data provided in the
|
|
210
|
+
request body. JSON format is expected.
|
|
211
|
+
parameters:
|
|
212
|
+
- in: path
|
|
213
|
+
name: instance_id
|
|
214
|
+
required: true
|
|
215
|
+
schema:
|
|
216
|
+
type: string
|
|
217
|
+
format: uuid
|
|
218
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
219
|
+
requestBody:
|
|
220
|
+
required: true
|
|
221
|
+
content:
|
|
222
|
+
application/json:
|
|
223
|
+
schema:
|
|
224
|
+
type: object
|
|
225
|
+
properties:
|
|
226
|
+
name:
|
|
227
|
+
type: string
|
|
228
|
+
example: updated_attachment.pdf
|
|
229
|
+
responses:
|
|
230
|
+
200:
|
|
231
|
+
description: Attachment file updated successfully
|
|
232
|
+
content:
|
|
233
|
+
application/json:
|
|
234
|
+
schema:
|
|
235
|
+
type: object
|
|
236
|
+
properties:
|
|
237
|
+
id:
|
|
238
|
+
type: string
|
|
239
|
+
format: uuid
|
|
240
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
241
|
+
name:
|
|
242
|
+
type: string
|
|
243
|
+
example: updated_attachment.pdf
|
|
244
|
+
created_at:
|
|
245
|
+
type: string
|
|
246
|
+
format: date-time
|
|
247
|
+
example: "2024-01-15T10:30:00Z"
|
|
248
|
+
updated_at:
|
|
249
|
+
type: string
|
|
250
|
+
format: date-time
|
|
251
|
+
example: "2024-01-15T11:00:00Z"
|
|
252
|
+
400:
|
|
253
|
+
description: Invalid data format or validation error
|
|
254
|
+
"""
|
|
255
|
+
return super().put(instance_id)
|
|
256
|
+
|
|
257
|
+
@jwt_required()
|
|
258
|
+
def delete(self, instance_id):
|
|
259
|
+
"""
|
|
260
|
+
Delete attachment file
|
|
261
|
+
---
|
|
262
|
+
tags:
|
|
263
|
+
- Crud
|
|
264
|
+
description: Delete an attachment file by its ID. Returns empty
|
|
265
|
+
response on success.
|
|
266
|
+
parameters:
|
|
267
|
+
- in: path
|
|
268
|
+
name: instance_id
|
|
269
|
+
required: true
|
|
270
|
+
schema:
|
|
271
|
+
type: string
|
|
272
|
+
format: uuid
|
|
273
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
274
|
+
responses:
|
|
275
|
+
204:
|
|
276
|
+
description: Attachment file deleted successfully
|
|
277
|
+
400:
|
|
278
|
+
description: Integrity error or cannot delete
|
|
279
|
+
"""
|
|
280
|
+
return super().delete(instance_id)
|
|
281
|
+
|
|
19
282
|
def check_read_permissions(self, instance):
|
|
20
283
|
attachment_file = instance
|
|
21
284
|
if attachment_file["comment_id"] is not None:
|
zou/app/blueprints/crud/base.py
CHANGED
|
@@ -153,18 +153,69 @@ class BaseModelsResource(Resource, ArgsMixin):
|
|
|
153
153
|
@jwt_required()
|
|
154
154
|
def get(self):
|
|
155
155
|
"""
|
|
156
|
-
|
|
156
|
+
Get models
|
|
157
157
|
---
|
|
158
158
|
tags:
|
|
159
159
|
- Crud
|
|
160
|
-
description:
|
|
160
|
+
description: Retrieve all entries for the given model. Supports
|
|
161
|
+
filtering via query parameters and pagination.
|
|
162
|
+
parameters:
|
|
163
|
+
- in: query
|
|
164
|
+
name: page
|
|
165
|
+
required: false
|
|
166
|
+
schema:
|
|
167
|
+
type: integer
|
|
168
|
+
example: 1
|
|
169
|
+
description: Page number for pagination
|
|
170
|
+
- in: query
|
|
171
|
+
name: limit
|
|
172
|
+
required: false
|
|
173
|
+
schema:
|
|
174
|
+
type: integer
|
|
175
|
+
example: 50
|
|
176
|
+
description: Number of results per page
|
|
177
|
+
- in: query
|
|
178
|
+
name: relations
|
|
179
|
+
required: false
|
|
180
|
+
schema:
|
|
181
|
+
type: boolean
|
|
182
|
+
default: false
|
|
183
|
+
example: false
|
|
184
|
+
description: Whether to include relations
|
|
161
185
|
responses:
|
|
162
186
|
200:
|
|
163
|
-
|
|
187
|
+
description: Models retrieved successfully
|
|
188
|
+
content:
|
|
189
|
+
application/json:
|
|
190
|
+
schema:
|
|
191
|
+
oneOf:
|
|
192
|
+
- type: array
|
|
193
|
+
items:
|
|
194
|
+
type: object
|
|
195
|
+
- type: object
|
|
196
|
+
properties:
|
|
197
|
+
data:
|
|
198
|
+
type: array
|
|
199
|
+
items:
|
|
200
|
+
type: object
|
|
201
|
+
example: []
|
|
202
|
+
total:
|
|
203
|
+
type: integer
|
|
204
|
+
example: 100
|
|
205
|
+
nb_pages:
|
|
206
|
+
type: integer
|
|
207
|
+
example: 2
|
|
208
|
+
limit:
|
|
209
|
+
type: integer
|
|
210
|
+
example: 50
|
|
211
|
+
offset:
|
|
212
|
+
type: integer
|
|
213
|
+
example: 0
|
|
214
|
+
page:
|
|
215
|
+
type: integer
|
|
216
|
+
example: 1
|
|
164
217
|
400:
|
|
165
|
-
|
|
166
|
-
403:
|
|
167
|
-
description: Permission denied
|
|
218
|
+
description: Invalid filter format or query error
|
|
168
219
|
"""
|
|
169
220
|
try:
|
|
170
221
|
query = self.model.query
|
|
@@ -206,36 +257,48 @@ class BaseModelsResource(Resource, ArgsMixin):
|
|
|
206
257
|
@jwt_required()
|
|
207
258
|
def post(self):
|
|
208
259
|
"""
|
|
209
|
-
Create
|
|
260
|
+
Create model
|
|
210
261
|
---
|
|
211
262
|
tags:
|
|
212
263
|
- Crud
|
|
213
|
-
description:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
264
|
+
description: Create a new model instance with data provided in the
|
|
265
|
+
request body. JSON format is expected. The model performs validation
|
|
266
|
+
automatically when instantiated.
|
|
267
|
+
requestBody:
|
|
268
|
+
required: true
|
|
269
|
+
content:
|
|
270
|
+
application/json:
|
|
271
|
+
schema:
|
|
218
272
|
type: object
|
|
219
273
|
properties:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
type: string
|
|
224
|
-
total:
|
|
225
|
-
type: integer
|
|
226
|
-
nb_pages:
|
|
227
|
-
type: integer
|
|
228
|
-
limit:
|
|
229
|
-
type: integer
|
|
230
|
-
offset:
|
|
231
|
-
type: integer
|
|
232
|
-
page:
|
|
233
|
-
type: integer
|
|
274
|
+
name:
|
|
275
|
+
type: string
|
|
276
|
+
example: Model Name
|
|
234
277
|
responses:
|
|
235
|
-
|
|
236
|
-
|
|
278
|
+
201:
|
|
279
|
+
description: Model created successfully
|
|
280
|
+
content:
|
|
281
|
+
application/json:
|
|
282
|
+
schema:
|
|
283
|
+
type: object
|
|
284
|
+
properties:
|
|
285
|
+
id:
|
|
286
|
+
type: string
|
|
287
|
+
format: uuid
|
|
288
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
289
|
+
name:
|
|
290
|
+
type: string
|
|
291
|
+
example: Model Name
|
|
292
|
+
created_at:
|
|
293
|
+
type: string
|
|
294
|
+
format: date-time
|
|
295
|
+
example: "2024-01-15T10:30:00Z"
|
|
296
|
+
updated_at:
|
|
297
|
+
type: string
|
|
298
|
+
format: date-time
|
|
299
|
+
example: "2024-01-15T10:30:00Z"
|
|
237
300
|
400:
|
|
238
|
-
|
|
301
|
+
description: Invalid data format or validation error
|
|
239
302
|
"""
|
|
240
303
|
try:
|
|
241
304
|
data = request.json
|
|
@@ -315,24 +378,53 @@ class BaseModelResource(Resource, ArgsMixin):
|
|
|
315
378
|
@jwt_required()
|
|
316
379
|
def get(self, instance_id):
|
|
317
380
|
"""
|
|
318
|
-
|
|
381
|
+
Get model
|
|
319
382
|
---
|
|
320
383
|
tags:
|
|
321
384
|
- Crud
|
|
385
|
+
description: Retrieve a model instance by its ID and return it as a
|
|
386
|
+
JSON object. Supports including relations.
|
|
322
387
|
parameters:
|
|
323
388
|
- in: path
|
|
324
389
|
name: instance_id
|
|
325
|
-
required:
|
|
326
|
-
|
|
327
|
-
|
|
390
|
+
required: true
|
|
391
|
+
schema:
|
|
392
|
+
type: string
|
|
393
|
+
format: uuid
|
|
328
394
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
395
|
+
- in: query
|
|
396
|
+
name: relations
|
|
397
|
+
required: false
|
|
398
|
+
schema:
|
|
399
|
+
type: boolean
|
|
400
|
+
default: true
|
|
401
|
+
example: true
|
|
402
|
+
description: Whether to include relations
|
|
329
403
|
responses:
|
|
330
404
|
200:
|
|
331
|
-
|
|
405
|
+
description: Model retrieved successfully
|
|
406
|
+
content:
|
|
407
|
+
application/json:
|
|
408
|
+
schema:
|
|
409
|
+
type: object
|
|
410
|
+
properties:
|
|
411
|
+
id:
|
|
412
|
+
type: string
|
|
413
|
+
format: uuid
|
|
414
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
415
|
+
name:
|
|
416
|
+
type: string
|
|
417
|
+
example: Model Name
|
|
418
|
+
created_at:
|
|
419
|
+
type: string
|
|
420
|
+
format: date-time
|
|
421
|
+
example: "2024-01-15T10:30:00Z"
|
|
422
|
+
updated_at:
|
|
423
|
+
type: string
|
|
424
|
+
format: date-time
|
|
425
|
+
example: "2024-01-15T10:30:00Z"
|
|
332
426
|
400:
|
|
333
|
-
|
|
334
|
-
404:
|
|
335
|
-
description: Value error
|
|
427
|
+
description: Invalid ID format or query error
|
|
336
428
|
"""
|
|
337
429
|
relations = self.get_bool_parameter("relations", "true")
|
|
338
430
|
try:
|
|
@@ -366,42 +458,56 @@ class BaseModelResource(Resource, ArgsMixin):
|
|
|
366
458
|
@jwt_required()
|
|
367
459
|
def put(self, instance_id):
|
|
368
460
|
"""
|
|
369
|
-
Update
|
|
461
|
+
Update model
|
|
370
462
|
---
|
|
371
463
|
tags:
|
|
372
464
|
- Crud
|
|
373
|
-
description:
|
|
465
|
+
description: Update a model instance with data provided in the
|
|
466
|
+
request body. JSON format is expected. Model performs validation
|
|
467
|
+
automatically when fields are modified.
|
|
374
468
|
parameters:
|
|
375
469
|
- in: path
|
|
376
470
|
name: instance_id
|
|
377
|
-
required:
|
|
378
|
-
type: string
|
|
379
|
-
format: uuid
|
|
380
|
-
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
381
|
-
- in: body
|
|
382
|
-
name: Model
|
|
471
|
+
required: true
|
|
383
472
|
schema:
|
|
473
|
+
type: string
|
|
474
|
+
format: uuid
|
|
475
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
476
|
+
requestBody:
|
|
477
|
+
required: true
|
|
478
|
+
content:
|
|
479
|
+
application/json:
|
|
480
|
+
schema:
|
|
384
481
|
type: object
|
|
385
482
|
properties:
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
type: string
|
|
390
|
-
total:
|
|
391
|
-
type: integer
|
|
392
|
-
nb_pages:
|
|
393
|
-
type: integer
|
|
394
|
-
limit:
|
|
395
|
-
type: integer
|
|
396
|
-
offset:
|
|
397
|
-
type: integer
|
|
398
|
-
page:
|
|
399
|
-
type: integer
|
|
483
|
+
name:
|
|
484
|
+
type: string
|
|
485
|
+
example: Updated Model Name
|
|
400
486
|
responses:
|
|
401
487
|
200:
|
|
402
|
-
|
|
488
|
+
description: Model updated successfully
|
|
489
|
+
content:
|
|
490
|
+
application/json:
|
|
491
|
+
schema:
|
|
492
|
+
type: object
|
|
493
|
+
properties:
|
|
494
|
+
id:
|
|
495
|
+
type: string
|
|
496
|
+
format: uuid
|
|
497
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
498
|
+
name:
|
|
499
|
+
type: string
|
|
500
|
+
example: Updated Model Name
|
|
501
|
+
created_at:
|
|
502
|
+
type: string
|
|
503
|
+
format: date-time
|
|
504
|
+
example: "2024-01-15T10:30:00Z"
|
|
505
|
+
updated_at:
|
|
506
|
+
type: string
|
|
507
|
+
format: date-time
|
|
508
|
+
example: "2024-01-15T11:00:00Z"
|
|
403
509
|
400:
|
|
404
|
-
|
|
510
|
+
description: Invalid data format or validation error
|
|
405
511
|
"""
|
|
406
512
|
try:
|
|
407
513
|
data = self.get_arguments()
|
|
@@ -432,24 +538,25 @@ class BaseModelResource(Resource, ArgsMixin):
|
|
|
432
538
|
@jwt_required()
|
|
433
539
|
def delete(self, instance_id):
|
|
434
540
|
"""
|
|
435
|
-
Delete
|
|
541
|
+
Delete model
|
|
436
542
|
---
|
|
437
543
|
tags:
|
|
438
544
|
- Crud
|
|
545
|
+
description: Delete a model instance by its ID. Returns empty
|
|
546
|
+
response on success.
|
|
439
547
|
parameters:
|
|
440
548
|
- in: path
|
|
441
549
|
name: instance_id
|
|
442
|
-
required:
|
|
443
|
-
|
|
444
|
-
|
|
550
|
+
required: true
|
|
551
|
+
schema:
|
|
552
|
+
type: string
|
|
553
|
+
format: uuid
|
|
445
554
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
446
555
|
responses:
|
|
447
556
|
204:
|
|
448
|
-
|
|
557
|
+
description: Model deleted successfully
|
|
449
558
|
400:
|
|
450
|
-
|
|
451
|
-
404:
|
|
452
|
-
description: Instance non-existant
|
|
559
|
+
description: Integrity error or cannot delete
|
|
453
560
|
"""
|
|
454
561
|
instance = self.get_model_or_404(instance_id)
|
|
455
562
|
|