muffin-rest 11.0.0__py3-none-any.whl → 11.0.1__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.
- muffin_rest/peewee/handler.py +4 -4
- {muffin_rest-11.0.0.dist-info → muffin_rest-11.0.1.dist-info}/METADATA +1 -1
- {muffin_rest-11.0.0.dist-info → muffin_rest-11.0.1.dist-info}/RECORD +5 -5
- {muffin_rest-11.0.0.dist-info → muffin_rest-11.0.1.dist-info}/LICENSE +0 -0
- {muffin_rest-11.0.0.dist-info → muffin_rest-11.0.1.dist-info}/WHEEL +0 -0
muffin_rest/peewee/handler.py
CHANGED
|
@@ -52,7 +52,7 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
52
52
|
) -> pw.ModelSelect: ...
|
|
53
53
|
|
|
54
54
|
# NOTE: there is not a default sorting for peewee (conflict with muffin-admin)
|
|
55
|
-
async def prepare_collection(self, _: Request):
|
|
55
|
+
async def prepare_collection(self, _: Request): # type: ignore[override]
|
|
56
56
|
"""Initialize Peeewee QuerySet for a binded to the resource model."""
|
|
57
57
|
return self.meta.model.select()
|
|
58
58
|
|
|
@@ -86,7 +86,7 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
86
86
|
self: PWRESTBase[pw.Model], _: Request, *, limit: int = 0, offset: int = 0
|
|
87
87
|
) -> tuple[pw.ModelSelect, int | None]: ...
|
|
88
88
|
|
|
89
|
-
async def paginate(self, _: Request, *, limit: int = 0, offset: int = 0):
|
|
89
|
+
async def paginate(self, _: Request, *, limit: int = 0, offset: int = 0): # type: ignore[override]
|
|
90
90
|
"""Paginate the collection."""
|
|
91
91
|
if self.meta.limit_total:
|
|
92
92
|
cqs = cast(pw.ModelSelect, self.collection.order_by())
|
|
@@ -114,9 +114,9 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
114
114
|
meta = self.meta
|
|
115
115
|
manager = meta.manager
|
|
116
116
|
if issubclass(meta.model, AIOModel):
|
|
117
|
-
await resource.save()
|
|
117
|
+
await resource.save(force_insert=not update)
|
|
118
118
|
else:
|
|
119
|
-
await manager.save(resource)
|
|
119
|
+
await manager.save(resource, force_insert=not update)
|
|
120
120
|
|
|
121
121
|
return resource
|
|
122
122
|
|
|
@@ -15,7 +15,7 @@ muffin_rest/openapi.py,sha256=0QU7qrfBjGl0vl378SJC5boZZI2ogddl45fS9WL4Axw,8751
|
|
|
15
15
|
muffin_rest/options.py,sha256=38y7AasyAghXNffxX-3xgqLbWDQ1RxAhg77ze7c0Mu0,2232
|
|
16
16
|
muffin_rest/peewee/__init__.py,sha256=94DSj_ftT6fbPksHlBv40AH2HWaiZommUFOMN2jd9a4,129
|
|
17
17
|
muffin_rest/peewee/filters.py,sha256=p813eJqyTkAhmS3C1P8rWFWb9Tl33OtADjgLctqKnns,2475
|
|
18
|
-
muffin_rest/peewee/handler.py,sha256=
|
|
18
|
+
muffin_rest/peewee/handler.py,sha256=cpHbtwPVyNp3FJtJr4drxvFyM_mq-JgwNBF4wvmYdIg,5461
|
|
19
19
|
muffin_rest/peewee/openapi.py,sha256=lDnLnoXi33p0YeFVwRgaVrndyrG2XL93RH-BzbxinOY,1105
|
|
20
20
|
muffin_rest/peewee/options.py,sha256=TimJtErC9e8B7BRiEkHiBZd71_bZbYr-FE2PIlQvfH0,1455
|
|
21
21
|
muffin_rest/peewee/schemas.py,sha256=w6jBziUp40mOOjkz_4RCXuY0x5ZDIe9Ob25k1FnZSfc,469
|
|
@@ -33,7 +33,7 @@ muffin_rest/sqlalchemy/types.py,sha256=Exm-zAQCtPAwXvYcCTtPRqSa-wTEWRcH_v2YSsJkB
|
|
|
33
33
|
muffin_rest/swagger.html,sha256=2uGLu_KpkYf925KnDKHBJmV9pm6OHn5C3BWScESsUS8,1736
|
|
34
34
|
muffin_rest/types.py,sha256=m27-g6BI7qdSWGym4fWALBJa2ZpWR0_m0nlrDx7iTCo,566
|
|
35
35
|
muffin_rest/utils.py,sha256=c08E4HJ4SLYC-91GKPEbsyKTZ4sZbTN4qDqJbNg_HTE,2076
|
|
36
|
-
muffin_rest-11.0.
|
|
37
|
-
muffin_rest-11.0.
|
|
38
|
-
muffin_rest-11.0.
|
|
39
|
-
muffin_rest-11.0.
|
|
36
|
+
muffin_rest-11.0.1.dist-info/LICENSE,sha256=xHPkOZhjyKBMOwXpWn9IB_BVLjrrMxv2M9slKkHj2hM,1082
|
|
37
|
+
muffin_rest-11.0.1.dist-info/METADATA,sha256=5091MXwTsurQRHcktQMiXUurYrCVM-nhueFAjIreZ7w,4147
|
|
38
|
+
muffin_rest-11.0.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
39
|
+
muffin_rest-11.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|