muffin-rest 10.1.0__tar.gz → 11.0.0__tar.gz
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-10.1.0 → muffin_rest-11.0.0}/PKG-INFO +1 -1
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/handler.py +8 -12
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/pyproject.toml +1 -1
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/LICENSE +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/README.rst +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/__init__.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/api.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/errors.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/filters.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/handler.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/limits.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/marshmallow.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/mongo/__init__.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/mongo/filters.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/mongo/schema.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/mongo/sorting.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/mongo/types.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/mongo/utils.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/openapi.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/options.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/__init__.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/filters.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/openapi.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/options.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/schemas.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/sorting.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/types.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/peewee/utils.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/py.typed +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/redoc.html +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/schemas.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/sorting.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/sqlalchemy/__init__.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/sqlalchemy/filters.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/sqlalchemy/sorting.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/sqlalchemy/types.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/swagger.html +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/types.py +0 -0
- {muffin_rest-10.1.0 → muffin_rest-11.0.0}/muffin_rest/utils.py +0 -0
|
@@ -43,15 +43,13 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
43
43
|
async def prepare_collection(
|
|
44
44
|
self: PWRESTBase[TVAIOModel],
|
|
45
45
|
_: Request,
|
|
46
|
-
) -> AIOModelSelect[TVAIOModel]:
|
|
47
|
-
...
|
|
46
|
+
) -> AIOModelSelect[TVAIOModel]: ...
|
|
48
47
|
|
|
49
48
|
@overload
|
|
50
49
|
async def prepare_collection(
|
|
51
50
|
self: PWRESTBase[pw.Model],
|
|
52
51
|
_: Request,
|
|
53
|
-
) -> pw.ModelSelect:
|
|
54
|
-
...
|
|
52
|
+
) -> pw.ModelSelect: ...
|
|
55
53
|
|
|
56
54
|
# NOTE: there is not a default sorting for peewee (conflict with muffin-admin)
|
|
57
55
|
async def prepare_collection(self, _: Request):
|
|
@@ -81,14 +79,12 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
81
79
|
@overload
|
|
82
80
|
async def paginate(
|
|
83
81
|
self: PWRESTBase[TVAIOModel], _: Request, *, limit: int = 0, offset: int = 0
|
|
84
|
-
) -> tuple[AIOModelSelect[TVAIOModel], int | None]:
|
|
85
|
-
...
|
|
82
|
+
) -> tuple[AIOModelSelect[TVAIOModel], int | None]: ...
|
|
86
83
|
|
|
87
84
|
@overload
|
|
88
85
|
async def paginate(
|
|
89
86
|
self: PWRESTBase[pw.Model], _: Request, *, limit: int = 0, offset: int = 0
|
|
90
|
-
) -> tuple[pw.ModelSelect, int | None]:
|
|
91
|
-
...
|
|
87
|
+
) -> tuple[pw.ModelSelect, int | None]: ...
|
|
92
88
|
|
|
93
89
|
async def paginate(self, _: Request, *, limit: int = 0, offset: int = 0):
|
|
94
90
|
"""Paginate the collection."""
|
|
@@ -136,9 +132,7 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
136
132
|
return
|
|
137
133
|
|
|
138
134
|
model_pk = cast(pw.Field, meta.model_pk)
|
|
139
|
-
resources = await meta.manager.fetchall(
|
|
140
|
-
self.collection.where(model_pk << data),
|
|
141
|
-
)
|
|
135
|
+
resources = await meta.manager.fetchall(self.collection.where(model_pk << data)) # type: ignore[]
|
|
142
136
|
|
|
143
137
|
if not resources:
|
|
144
138
|
raise APIError.NOT_FOUND()
|
|
@@ -151,7 +145,9 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
151
145
|
for res in resources:
|
|
152
146
|
await meta.manager.delete_instance(res, recursive=meta.delete_recursive)
|
|
153
147
|
|
|
154
|
-
|
|
148
|
+
return resource.get_id() if resource else [r.get_id() for r in resources]
|
|
149
|
+
|
|
150
|
+
async def delete(self, request: Request, resource: Optional[TVModel] = None): # type: ignore[override]
|
|
155
151
|
return await self.remove(request, resource)
|
|
156
152
|
|
|
157
153
|
def get_schema(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|