muffin-rest 9.0.0__tar.gz → 9.1.1__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-9.0.0 → muffin_rest-9.1.1}/PKG-INFO +4 -4
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/handler.py +10 -10
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/pyproject.toml +8 -8
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/LICENSE +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/README.rst +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/api.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/errors.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/handler.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/limits.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/marshmallow.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/schema.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/utils.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/openapi.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/options.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/openapi.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/options.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/schemas.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/utils.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/py.typed +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/redoc.html +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/schemas.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/swagger.html +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: muffin-rest
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.1.1
|
|
4
4
|
Summary: The package provides enhanced support for writing REST APIs with Muffin framework
|
|
5
5
|
Home-page: https://github.com/klen/muffin-rest
|
|
6
6
|
License: MIT
|
|
@@ -26,11 +26,11 @@ Provides-Extra: sqlalchemy
|
|
|
26
26
|
Provides-Extra: yaml
|
|
27
27
|
Requires-Dist: apispec (>=6,<7)
|
|
28
28
|
Requires-Dist: marshmallow (>=3,<4)
|
|
29
|
-
Requires-Dist: marshmallow-peewee
|
|
29
|
+
Requires-Dist: marshmallow-peewee ; extra == "peewee"
|
|
30
30
|
Requires-Dist: marshmallow-sqlalchemy ; extra == "sqlalchemy"
|
|
31
31
|
Requires-Dist: muffin (>=0,<1)
|
|
32
|
-
Requires-Dist: muffin-databases
|
|
33
|
-
Requires-Dist: muffin-peewee-aio
|
|
32
|
+
Requires-Dist: muffin-databases ; extra == "sqlalchemy"
|
|
33
|
+
Requires-Dist: muffin-peewee-aio ; extra == "peewee"
|
|
34
34
|
Requires-Dist: pyyaml ; extra == "yaml"
|
|
35
35
|
Requires-Dist: sqlalchemy ; extra == "sqlalchemy"
|
|
36
36
|
Project-URL: Repository, https://github.com/klen/muffin-rest
|
|
@@ -92,18 +92,18 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
|
|
|
92
92
|
|
|
93
93
|
async def paginate(self, _: Request, *, limit: int = 0, offset: int = 0):
|
|
94
94
|
"""Paginate the collection."""
|
|
95
|
-
cqs = cast(pw.ModelSelect, self.collection.order_by())
|
|
96
|
-
if cqs._group_by: # type: ignore[misc]
|
|
97
|
-
cqs._returning = cqs._group_by # type: ignore[misc]
|
|
98
|
-
cqs._having = None # type: ignore[misc]
|
|
99
|
-
count = None
|
|
100
95
|
if self.meta.limit_total:
|
|
101
|
-
|
|
96
|
+
cqs = cast(pw.ModelSelect, self.collection.order_by())
|
|
97
|
+
if cqs._group_by: # type: ignore[misc]
|
|
98
|
+
cqs._returning = cqs._group_by # type: ignore[misc]
|
|
99
|
+
cqs._having = None # type: ignore[misc]
|
|
102
100
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
count = await self.meta.manager.count(cqs)
|
|
102
|
+
|
|
103
|
+
else:
|
|
104
|
+
count = None
|
|
105
|
+
|
|
106
|
+
return self.collection.offset(offset).limit(limit), count
|
|
107
107
|
|
|
108
108
|
async def get(self, request, *, resource: Optional[TVModel] = None) -> Any:
|
|
109
109
|
"""Get resource or collection of resources."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "muffin-rest"
|
|
3
|
-
version = "9.
|
|
3
|
+
version = "9.1.1"
|
|
4
4
|
description = "The package provides enhanced support for writing REST APIs with Muffin framework"
|
|
5
5
|
readme = "README.rst"
|
|
6
6
|
homepage = "https://github.com/klen/muffin-rest"
|
|
@@ -31,9 +31,9 @@ muffin = "^0"
|
|
|
31
31
|
|
|
32
32
|
# Optional dependencies
|
|
33
33
|
pyyaml = { version = "*", optional = true }
|
|
34
|
-
muffin-peewee-aio = { version = "
|
|
35
|
-
marshmallow-peewee = { version = "
|
|
36
|
-
muffin-databases = { version = "
|
|
34
|
+
muffin-peewee-aio = { version = "*", optional = true }
|
|
35
|
+
marshmallow-peewee = { version = "*", optional = true }
|
|
36
|
+
muffin-databases = { version = "*", optional = true }
|
|
37
37
|
marshmallow-sqlalchemy = { version = "*", optional = true }
|
|
38
38
|
sqlalchemy = { version = "*", optional = true }
|
|
39
39
|
|
|
@@ -44,10 +44,10 @@ sqlalchemy = ["muffin-databases", "marshmallow-sqlalchemy", "sqlalchemy"]
|
|
|
44
44
|
|
|
45
45
|
[tool.poetry.group.tests.dependencies]
|
|
46
46
|
aiosqlite = "*"
|
|
47
|
-
marshmallow-peewee = "
|
|
47
|
+
marshmallow-peewee = "*"
|
|
48
48
|
marshmallow-sqlalchemy = "*"
|
|
49
|
-
muffin-databases = "
|
|
50
|
-
muffin-mongo = "
|
|
49
|
+
muffin-databases = "*"
|
|
50
|
+
muffin-mongo = "*"
|
|
51
51
|
muffin-peewee-aio = "*"
|
|
52
52
|
pytest = "*"
|
|
53
53
|
pytest-aio = { version = "*", extras = ["curio", "trio"] }
|
|
@@ -63,7 +63,7 @@ pre-commit = "*"
|
|
|
63
63
|
[tool.poetry.group.example.dependencies]
|
|
64
64
|
uvicorn = "*"
|
|
65
65
|
muffin-peewee-aio = "*"
|
|
66
|
-
marshmallow-peewee = "
|
|
66
|
+
marshmallow-peewee = "*"
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
[tool.pytest.ini_options]
|
|
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
|