muffin-rest 9.0.0__tar.gz → 9.2.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-9.0.0 → muffin_rest-9.2.0}/PKG-INFO +4 -4
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/handler.py +10 -10
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/pyproject.toml +11 -10
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/LICENSE +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/README.rst +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/api.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/errors.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/handler.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/limits.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/marshmallow.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/mongo/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/mongo/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/mongo/schema.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/mongo/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/mongo/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/mongo/utils.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/openapi.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/options.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/openapi.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/options.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/schemas.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/peewee/utils.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/py.typed +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/redoc.html +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/schemas.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/sqlalchemy/__init__.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/sqlalchemy/filters.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/sqlalchemy/sorting.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/sqlalchemy/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/swagger.html +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/muffin_rest/types.py +0 -0
- {muffin_rest-9.0.0 → muffin_rest-9.2.0}/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.2.0
|
|
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.2.0"
|
|
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"
|
|
@@ -18,6 +18,7 @@ classifiers = [
|
|
|
18
18
|
"Programming Language :: Python :: 3.10",
|
|
19
19
|
"Programming Language :: Python :: 3.11",
|
|
20
20
|
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
21
22
|
"Topic :: Internet :: WWW/HTTP",
|
|
22
23
|
"Framework :: AsyncIO",
|
|
23
24
|
"Framework :: Trio",
|
|
@@ -31,9 +32,9 @@ muffin = "^0"
|
|
|
31
32
|
|
|
32
33
|
# Optional dependencies
|
|
33
34
|
pyyaml = { version = "*", optional = true }
|
|
34
|
-
muffin-peewee-aio = { version = "
|
|
35
|
-
marshmallow-peewee = { version = "
|
|
36
|
-
muffin-databases = { version = "
|
|
35
|
+
muffin-peewee-aio = { version = "*", optional = true }
|
|
36
|
+
marshmallow-peewee = { version = "*", optional = true }
|
|
37
|
+
muffin-databases = { version = "*", optional = true }
|
|
37
38
|
marshmallow-sqlalchemy = { version = "*", optional = true }
|
|
38
39
|
sqlalchemy = { version = "*", optional = true }
|
|
39
40
|
|
|
@@ -44,10 +45,10 @@ sqlalchemy = ["muffin-databases", "marshmallow-sqlalchemy", "sqlalchemy"]
|
|
|
44
45
|
|
|
45
46
|
[tool.poetry.group.tests.dependencies]
|
|
46
47
|
aiosqlite = "*"
|
|
47
|
-
marshmallow-peewee = "
|
|
48
|
+
marshmallow-peewee = "*"
|
|
48
49
|
marshmallow-sqlalchemy = "*"
|
|
49
|
-
muffin-databases = "
|
|
50
|
-
muffin-mongo = "
|
|
50
|
+
muffin-databases = "*"
|
|
51
|
+
muffin-mongo = "*"
|
|
51
52
|
muffin-peewee-aio = "*"
|
|
52
53
|
pytest = "*"
|
|
53
54
|
pytest-aio = { version = "*", extras = ["curio", "trio"] }
|
|
@@ -63,7 +64,7 @@ pre-commit = "*"
|
|
|
63
64
|
[tool.poetry.group.example.dependencies]
|
|
64
65
|
uvicorn = "*"
|
|
65
66
|
muffin-peewee-aio = "*"
|
|
66
|
-
marshmallow-peewee = "
|
|
67
|
+
marshmallow-peewee = "*"
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
[tool.pytest.ini_options]
|
|
@@ -77,7 +78,7 @@ ignore_missing_imports = true
|
|
|
77
78
|
[tool.tox]
|
|
78
79
|
legacy_tox_ini = """
|
|
79
80
|
[tox]
|
|
80
|
-
envlist = py39,py310,py311,py312,pypy39
|
|
81
|
+
envlist = py39,py310,py311,py312,py313,pypy39
|
|
81
82
|
|
|
82
83
|
[testenv]
|
|
83
84
|
deps = -e .[tests]
|
|
@@ -116,7 +117,7 @@ ignore = [
|
|
|
116
117
|
|
|
117
118
|
[tool.black]
|
|
118
119
|
line-length = 100
|
|
119
|
-
target-version = ["py39", "py310", "py311", "py312"]
|
|
120
|
+
target-version = ["py39", "py310", "py311", "py312", "py313"]
|
|
120
121
|
preview = true
|
|
121
122
|
|
|
122
123
|
[build-system]
|
|
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
|