django-ninja-aio-crud 0.9.1__py3-none-any.whl → 0.9.2__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.
- {django_ninja_aio_crud-0.9.1.dist-info → django_ninja_aio_crud-0.9.2.dist-info}/METADATA +1 -1
- {django_ninja_aio_crud-0.9.1.dist-info → django_ninja_aio_crud-0.9.2.dist-info}/RECORD +6 -6
- ninja_aio/__init__.py +1 -1
- ninja_aio/views.py +13 -17
- {django_ninja_aio_crud-0.9.1.dist-info → django_ninja_aio_crud-0.9.2.dist-info}/WHEEL +0 -0
- {django_ninja_aio_crud-0.9.1.dist-info → django_ninja_aio_crud-0.9.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ninja_aio/__init__.py,sha256=
|
|
1
|
+
ninja_aio/__init__.py,sha256=UJdb6o-2Z5BeBJ8jFYE2A0fdLgDvon31_Po-CVA8R5c,119
|
|
2
2
|
ninja_aio/api.py,sha256=Fe6l3YCy7MW5TY4-Lbl80CFuK2NT2Y7tHfmqPk6Mqak,1735
|
|
3
3
|
ninja_aio/auth.py,sha256=fKboioU4sezPukKJukIwiboxml_KV7irhCH3vGYt5pU,1008
|
|
4
4
|
ninja_aio/exceptions.py,sha256=gPnZX1Do2GXudbU8wDYkwhO70Qj0ZNrIJJ2UXRs9vYk,2241
|
|
@@ -7,8 +7,8 @@ ninja_aio/parsers.py,sha256=e_4lGCPV7zs-HTqtdJTc8yQD2KPAn9njbL8nF_Mmgkc,153
|
|
|
7
7
|
ninja_aio/renders.py,sha256=0eYklRKd59aV4cZDom5vLZyA99Ob17OwkpMybsRXvyg,1970
|
|
8
8
|
ninja_aio/schemas.py,sha256=EgRkfhnzZqwGvdBmqlZixMtMcoD1ZxV_qzJ3fmaAy20,113
|
|
9
9
|
ninja_aio/types.py,sha256=TJSGlA7bt4g9fvPhJ7gzH5tKbLagPmZUzfgttEOp4xs,468
|
|
10
|
-
ninja_aio/views.py,sha256=
|
|
11
|
-
django_ninja_aio_crud-0.9.
|
|
12
|
-
django_ninja_aio_crud-0.9.
|
|
13
|
-
django_ninja_aio_crud-0.9.
|
|
14
|
-
django_ninja_aio_crud-0.9.
|
|
10
|
+
ninja_aio/views.py,sha256=ch5Sy8JiTFFTiaoecYHqAPOM2IPxqBQvmrXx9Pn5xho,13936
|
|
11
|
+
django_ninja_aio_crud-0.9.2.dist-info/licenses/LICENSE,sha256=yrDAYcm0gRp_Qyzo3GQa4BjYjWRkAhGC8QRva__RYq0,1073
|
|
12
|
+
django_ninja_aio_crud-0.9.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
13
|
+
django_ninja_aio_crud-0.9.2.dist-info/METADATA,sha256=6gVLn2-uAcVeCw-BRLHCwprYv0P4xGRExLjB8dYrrH4,14138
|
|
14
|
+
django_ninja_aio_crud-0.9.2.dist-info/RECORD,,
|
ninja_aio/__init__.py
CHANGED
ninja_aio/views.py
CHANGED
|
@@ -219,13 +219,12 @@ class APIViewSet:
|
|
|
219
219
|
return queryset
|
|
220
220
|
|
|
221
221
|
def create_view(self):
|
|
222
|
-
@self.
|
|
223
|
-
|
|
222
|
+
@self.router.post(
|
|
223
|
+
self.path,
|
|
224
224
|
auth=self.post_view_auth(),
|
|
225
225
|
summary=f"Create {self.model._meta.verbose_name.capitalize()}",
|
|
226
226
|
description=self.create_docs,
|
|
227
227
|
response={201: self.schema_out, self.error_codes: GenericMessageSchema},
|
|
228
|
-
tags=[self.router_tag],
|
|
229
228
|
)
|
|
230
229
|
async def create(request: HttpRequest, data: self.schema_in): # type: ignore
|
|
231
230
|
return 201, await self.model_util.create_s(request, data, self.schema_out)
|
|
@@ -234,8 +233,8 @@ class APIViewSet:
|
|
|
234
233
|
return create
|
|
235
234
|
|
|
236
235
|
def list_view(self):
|
|
237
|
-
@self.
|
|
238
|
-
self.
|
|
236
|
+
@self.router.get(
|
|
237
|
+
self.get_path,
|
|
239
238
|
auth=self.get_view_auth(),
|
|
240
239
|
summary=f"List {self.model._meta.verbose_name_plural.capitalize()}",
|
|
241
240
|
description=self.list_docs,
|
|
@@ -243,7 +242,6 @@ class APIViewSet:
|
|
|
243
242
|
200: List[self.schema_out],
|
|
244
243
|
self.error_codes: GenericMessageSchema,
|
|
245
244
|
},
|
|
246
|
-
tags=[self.router_tag],
|
|
247
245
|
)
|
|
248
246
|
@paginate(self.pagination_class)
|
|
249
247
|
async def list(
|
|
@@ -268,13 +266,12 @@ class APIViewSet:
|
|
|
268
266
|
return list
|
|
269
267
|
|
|
270
268
|
def retrieve_view(self):
|
|
271
|
-
@self.
|
|
272
|
-
|
|
269
|
+
@self.router.get(
|
|
270
|
+
self.get_path_retrieve,
|
|
273
271
|
auth=self.get_view_auth(),
|
|
274
272
|
summary=f"Retrieve {self.model._meta.verbose_name.capitalize()}",
|
|
275
273
|
description=self.retrieve_docs,
|
|
276
274
|
response={200: self.schema_out, self.error_codes: GenericMessageSchema},
|
|
277
|
-
tags=[self.router_tag],
|
|
278
275
|
)
|
|
279
276
|
async def retrieve(request: HttpRequest, pk: Path[self.path_schema]): # type: ignore
|
|
280
277
|
obj = await self.model_util.get_object(request, self._get_pk(pk))
|
|
@@ -284,13 +281,12 @@ class APIViewSet:
|
|
|
284
281
|
return retrieve
|
|
285
282
|
|
|
286
283
|
def update_view(self):
|
|
287
|
-
@self.
|
|
288
|
-
|
|
284
|
+
@self.router.patch(
|
|
285
|
+
self.path_retrieve,
|
|
289
286
|
auth=self.patch_view_auth(),
|
|
290
287
|
summary=f"Update {self.model._meta.verbose_name.capitalize()}",
|
|
291
288
|
description=self.update_docs,
|
|
292
289
|
response={200: self.schema_out, self.error_codes: GenericMessageSchema},
|
|
293
|
-
tags=[self.router_tag],
|
|
294
290
|
)
|
|
295
291
|
async def update(
|
|
296
292
|
request: HttpRequest,
|
|
@@ -305,13 +301,12 @@ class APIViewSet:
|
|
|
305
301
|
return update
|
|
306
302
|
|
|
307
303
|
def delete_view(self):
|
|
308
|
-
@self.
|
|
309
|
-
|
|
304
|
+
@self.router.delete(
|
|
305
|
+
self.path_retrieve,
|
|
310
306
|
auth=self.delete_view_auth(),
|
|
311
307
|
summary=f"Delete {self.model._meta.verbose_name.capitalize()}",
|
|
312
308
|
description=self.delete_docs,
|
|
313
309
|
response={204: None, self.error_codes: GenericMessageSchema},
|
|
314
|
-
tags=[self.router_tag],
|
|
315
310
|
)
|
|
316
311
|
async def delete(request: HttpRequest, pk: Path[self.path_schema]): # type: ignore
|
|
317
312
|
return 204, await self.model_util.delete_s(request, self._get_pk(pk))
|
|
@@ -367,5 +362,6 @@ class APIViewSet:
|
|
|
367
362
|
return self.router
|
|
368
363
|
|
|
369
364
|
def add_views_to_route(self):
|
|
370
|
-
self.
|
|
371
|
-
|
|
365
|
+
return self.api.add_router(
|
|
366
|
+
f"{self.api_route_path}", self._add_views()
|
|
367
|
+
)
|
|
File without changes
|
{django_ninja_aio_crud-0.9.1.dist-info → django_ninja_aio_crud-0.9.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|