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.
Files changed (39) hide show
  1. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/PKG-INFO +4 -4
  2. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/handler.py +10 -10
  3. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/pyproject.toml +8 -8
  4. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/LICENSE +0 -0
  5. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/README.rst +0 -0
  6. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/__init__.py +0 -0
  7. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/api.py +0 -0
  8. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/errors.py +0 -0
  9. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/filters.py +0 -0
  10. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/handler.py +0 -0
  11. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/limits.py +0 -0
  12. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/marshmallow.py +0 -0
  13. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/__init__.py +0 -0
  14. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/filters.py +0 -0
  15. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/schema.py +0 -0
  16. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/sorting.py +0 -0
  17. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/types.py +0 -0
  18. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/mongo/utils.py +0 -0
  19. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/openapi.py +0 -0
  20. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/options.py +0 -0
  21. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/__init__.py +0 -0
  22. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/filters.py +0 -0
  23. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/openapi.py +0 -0
  24. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/options.py +0 -0
  25. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/schemas.py +0 -0
  26. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/sorting.py +0 -0
  27. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/types.py +0 -0
  28. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/peewee/utils.py +0 -0
  29. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/py.typed +0 -0
  30. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/redoc.html +0 -0
  31. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/schemas.py +0 -0
  32. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sorting.py +0 -0
  33. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/__init__.py +0 -0
  34. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/filters.py +0 -0
  35. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/sorting.py +0 -0
  36. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/sqlalchemy/types.py +0 -0
  37. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/swagger.html +0 -0
  38. {muffin_rest-9.0.0 → muffin_rest-9.1.1}/muffin_rest/types.py +0 -0
  39. {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.0.0
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 (>=4,<5) ; extra == "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 (>=0.5.0,<0.6.0) ; extra == "sqlalchemy"
33
- Requires-Dist: muffin-peewee-aio (>=0,<1) ; extra == "peewee"
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
- count = await self.meta.manager.count(self.collection)
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
- return (
104
- cast(pw.ModelSelect, self.collection.offset(offset).limit(limit)), # type: ignore[misc]
105
- count,
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.0.0"
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 = "^0", optional = true }
35
- marshmallow-peewee = { version = "^4", optional = true }
36
- muffin-databases = { version = "^0.5.0", optional = true }
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 = "^4.0.3"
47
+ marshmallow-peewee = "*"
48
48
  marshmallow-sqlalchemy = "*"
49
- muffin-databases = "^0.5.0"
50
- muffin-mongo = "^0.5.1"
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 = "^4.0.3"
66
+ marshmallow-peewee = "*"
67
67
 
68
68
 
69
69
  [tool.pytest.ini_options]
File without changes
File without changes