muffin-rest 12.0.2__py3-none-any.whl → 12.0.3__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/mongo/__init__.py +3 -3
- muffin_rest/peewee/handler.py +6 -6
- muffin_rest/sqlalchemy/__init__.py +2 -2
- {muffin_rest-12.0.2.dist-info → muffin_rest-12.0.3.dist-info}/METADATA +1 -1
- {muffin_rest-12.0.2.dist-info → muffin_rest-12.0.3.dist-info}/RECORD +7 -7
- {muffin_rest-12.0.2.dist-info → muffin_rest-12.0.3.dist-info}/LICENSE +0 -0
- {muffin_rest-12.0.2.dist-info → muffin_rest-12.0.3.dist-info}/WHEEL +0 -0
muffin_rest/mongo/__init__.py
CHANGED
|
@@ -52,12 +52,12 @@ class MongoRESTHandler(RESTHandler[TVResource]):
|
|
|
52
52
|
meta: MongoRESTOptions
|
|
53
53
|
meta_class: type[MongoRESTOptions] = MongoRESTOptions
|
|
54
54
|
|
|
55
|
-
async def prepare_collection(self,
|
|
55
|
+
async def prepare_collection(self, request: Request) -> MongoChain:
|
|
56
56
|
"""Initialize Peeewee QuerySet for a binded to the resource model."""
|
|
57
57
|
return MongoChain(self.meta.collection)
|
|
58
58
|
|
|
59
59
|
async def paginate(
|
|
60
|
-
self,
|
|
60
|
+
self, request: Request, *, limit: int = 0, offset: int = 0
|
|
61
61
|
) -> tuple[motor.AsyncIOMotorCursor, int | None]:
|
|
62
62
|
"""Paginate collection."""
|
|
63
63
|
if self.meta.aggregate:
|
|
@@ -103,7 +103,7 @@ class MongoRESTHandler(RESTHandler[TVResource]):
|
|
|
103
103
|
"""Initialize marshmallow schema for serialization/deserialization."""
|
|
104
104
|
return super().get_schema(request, instance=resource, **schema_options)
|
|
105
105
|
|
|
106
|
-
async def save(self,
|
|
106
|
+
async def save(self, request: Request, resource: TVResource, *, update=False) -> TVResource:
|
|
107
107
|
"""Save the given resource."""
|
|
108
108
|
meta = self.meta
|
|
109
109
|
collection_id = meta.collection_id
|
muffin_rest/peewee/handler.py
CHANGED
|
@@ -42,17 +42,17 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
42
42
|
@overload
|
|
43
43
|
async def prepare_collection(
|
|
44
44
|
self: PWRESTBase[TVAIOModel],
|
|
45
|
-
|
|
45
|
+
request: Request,
|
|
46
46
|
) -> AIOModelSelect[TVAIOModel]: ...
|
|
47
47
|
|
|
48
48
|
@overload
|
|
49
49
|
async def prepare_collection(
|
|
50
50
|
self: PWRESTBase[pw.Model],
|
|
51
|
-
|
|
51
|
+
request: Request,
|
|
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,
|
|
55
|
+
async def prepare_collection(self, request: Request):
|
|
56
56
|
"""Initialize Peeewee QuerySet for a binded to the resource model."""
|
|
57
57
|
return self.meta.model.select()
|
|
58
58
|
|
|
@@ -78,15 +78,15 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
78
78
|
|
|
79
79
|
@overload
|
|
80
80
|
async def paginate(
|
|
81
|
-
self: PWRESTBase[TVAIOModel],
|
|
81
|
+
self: PWRESTBase[TVAIOModel], request: Request, *, limit: int = 0, offset: int = 0
|
|
82
82
|
) -> tuple[AIOModelSelect[TVAIOModel], int | None]: ...
|
|
83
83
|
|
|
84
84
|
@overload
|
|
85
85
|
async def paginate(
|
|
86
|
-
self: PWRESTBase[pw.Model],
|
|
86
|
+
self: PWRESTBase[pw.Model], request: Request, *, limit: int = 0, offset: int = 0
|
|
87
87
|
) -> tuple[pw.ModelSelect, int | None]: ...
|
|
88
88
|
|
|
89
|
-
async def paginate(self,
|
|
89
|
+
async def paginate(self, request: Request, *, limit: int = 0, offset: int = 0):
|
|
90
90
|
"""Paginate the collection."""
|
|
91
91
|
if self.meta.limit_total:
|
|
92
92
|
cqs = cast("pw.ModelSelect", self.collection.order_by())
|
|
@@ -114,13 +114,13 @@ class SARESTHandler(RESTHandler[TVResource]):
|
|
|
114
114
|
meta_class: type[SARESTOptions] = SARESTOptions
|
|
115
115
|
collection: sa.sql.Select
|
|
116
116
|
|
|
117
|
-
async def prepare_collection(self,
|
|
117
|
+
async def prepare_collection(self, request: Request) -> sa.sql.Select:
|
|
118
118
|
"""Initialize Peeewee QuerySet for a binded to the resource model."""
|
|
119
119
|
return self.meta.table.select()
|
|
120
120
|
|
|
121
121
|
async def paginate(
|
|
122
122
|
self,
|
|
123
|
-
|
|
123
|
+
request: Request,
|
|
124
124
|
*,
|
|
125
125
|
limit: int = 0,
|
|
126
126
|
offset: int = 0,
|
|
@@ -5,7 +5,7 @@ muffin_rest/filters.py,sha256=nWlwDLuId-mmP3tgZjp1joYCVx0k9ekV42fPIMMKphM,5920
|
|
|
5
5
|
muffin_rest/handler.py,sha256=qpG4ioIagdYqGFOrlT7pBx-0czgS2ZI3AvqKXz9EzcA,10762
|
|
6
6
|
muffin_rest/limits.py,sha256=Fnlu4Wj3B-BzpahLK-rDbd1GEd7CEQ3zxyOD0vee7GE,2007
|
|
7
7
|
muffin_rest/marshmallow.py,sha256=-MyMKiaMTfiWw4y-4adpfoQd05HV1vEKqSXJh8eD3xg,548
|
|
8
|
-
muffin_rest/mongo/__init__.py,sha256=
|
|
8
|
+
muffin_rest/mongo/__init__.py,sha256=xKwIJtDhQFZBmLUWZrZox9ootK3S4UVy0EZ14oF0L20,4662
|
|
9
9
|
muffin_rest/mongo/filters.py,sha256=yIxIDVqMn6SoDgVhCqiTxYetw0hoaf_3jIvX2Vnizok,964
|
|
10
10
|
muffin_rest/mongo/schema.py,sha256=y4OEPQnlV_COTIIQ3cKmpqDpD2r18eAWn0rijQldWm0,1205
|
|
11
11
|
muffin_rest/mongo/sorting.py,sha256=iJBnaFwE7g_JMwpGpQkoqSqbQK9XULx1K3skiRRgLgY,870
|
|
@@ -15,7 +15,7 @@ muffin_rest/openapi.py,sha256=VrkyZr_T0ykAQsvkFQ_yarZ-Zs55AmAGf4aNLsUdjGA,8715
|
|
|
15
15
|
muffin_rest/options.py,sha256=Mzv0mq6YylL6cNtad9JhEhkmA4RgmDsu-On2hn5VEiw,2208
|
|
16
16
|
muffin_rest/peewee/__init__.py,sha256=94DSj_ftT6fbPksHlBv40AH2HWaiZommUFOMN2jd9a4,129
|
|
17
17
|
muffin_rest/peewee/filters.py,sha256=8CqleDEn4vVQvBLXEaGOjM2N7sY117EQ4GThPhlDPE8,2494
|
|
18
|
-
muffin_rest/peewee/handler.py,sha256=
|
|
18
|
+
muffin_rest/peewee/handler.py,sha256=MhRYQokaEt-NIrMdFiJLcZwp4h0A5LKCwHOb36vm5m0,5402
|
|
19
19
|
muffin_rest/peewee/openapi.py,sha256=ktgsmB9wFNvcTbTaDkMQFLdQxk3osDFW5LkUSFVjcQo,1093
|
|
20
20
|
muffin_rest/peewee/options.py,sha256=TimJtErC9e8B7BRiEkHiBZd71_bZbYr-FE2PIlQvfH0,1455
|
|
21
21
|
muffin_rest/peewee/schemas.py,sha256=hQG2UKR7gEMsz0n75L3tvkVzUX3baXMJ94emgIc1Scw,439
|
|
@@ -26,14 +26,14 @@ muffin_rest/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
26
26
|
muffin_rest/redoc.html,sha256=GtuHIMvTuSi8Ro6bgI-G8VB94AljMyfjcZseqtBmGCY,559
|
|
27
27
|
muffin_rest/schemas.py,sha256=BW3dF82C6Q6STs4tZjej1x8Ii1rI3EZUJZR4mNNKmu4,875
|
|
28
28
|
muffin_rest/sorting.py,sha256=nu4SGW5uxLETJIywE-1UTCCya9QAvYWcq-P8dPWQixI,2822
|
|
29
|
-
muffin_rest/sqlalchemy/__init__.py,sha256=
|
|
29
|
+
muffin_rest/sqlalchemy/__init__.py,sha256=GMtnX3C5H9okEYjkaTHXd6Wna8F1Y6YAr1upT-cFOiM,6335
|
|
30
30
|
muffin_rest/sqlalchemy/filters.py,sha256=Lf1nPOQjDT7Nv1HAwowfWYTHWCrIMpw-4aWwoaNVlVU,2475
|
|
31
31
|
muffin_rest/sqlalchemy/sorting.py,sha256=qmzP18ongriCGs2Ok_OllEybqWgppU-Kakg0JL1DM_M,1690
|
|
32
32
|
muffin_rest/sqlalchemy/types.py,sha256=Exm-zAQCtPAwXvYcCTtPRqSa-wTEWRcH_v2YSsJkB6s,198
|
|
33
33
|
muffin_rest/swagger.html,sha256=2uGLu_KpkYf925KnDKHBJmV9pm6OHn5C3BWScESsUS8,1736
|
|
34
34
|
muffin_rest/types.py,sha256=5NY9gPTIptv6U2Qab2xMXlS_jZuTuR0bquFFwWRURcA,510
|
|
35
35
|
muffin_rest/utils.py,sha256=c08E4HJ4SLYC-91GKPEbsyKTZ4sZbTN4qDqJbNg_HTE,2076
|
|
36
|
-
muffin_rest-12.0.
|
|
37
|
-
muffin_rest-12.0.
|
|
38
|
-
muffin_rest-12.0.
|
|
39
|
-
muffin_rest-12.0.
|
|
36
|
+
muffin_rest-12.0.3.dist-info/LICENSE,sha256=xHPkOZhjyKBMOwXpWn9IB_BVLjrrMxv2M9slKkHj2hM,1082
|
|
37
|
+
muffin_rest-12.0.3.dist-info/METADATA,sha256=T3T6CJgnSSKsPNuRdmtGt5rOxG1X88KXopVorg7SldQ,4912
|
|
38
|
+
muffin_rest-12.0.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
39
|
+
muffin_rest-12.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|