muffin-rest 5.1.6__tar.gz → 5.1.8__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 (36) hide show
  1. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/PKG-INFO +1 -1
  2. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/handler.py +1 -0
  3. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/schemas.py +4 -1
  4. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/sorting.py +4 -2
  5. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/pyproject.toml +1 -1
  6. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/LICENSE +0 -0
  7. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/README.rst +0 -0
  8. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/__init__.py +0 -0
  9. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/api.py +0 -0
  10. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/errors.py +0 -0
  11. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/filters.py +0 -0
  12. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/handler.py +0 -0
  13. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/__init__.py +0 -0
  14. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/filters.py +0 -0
  15. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/schema.py +0 -0
  16. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/sorting.py +0 -0
  17. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/types.py +0 -0
  18. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/utils.py +0 -0
  19. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/openapi.py +0 -0
  20. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/options.py +0 -0
  21. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/__init__.py +0 -0
  22. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/filters.py +0 -0
  23. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/openapi.py +0 -0
  24. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/options.py +0 -0
  25. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/types.py +0 -0
  26. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/utils.py +0 -0
  27. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/py.typed +0 -0
  28. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/redoc.html +0 -0
  29. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sorting.py +0 -0
  30. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/__init__.py +0 -0
  31. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/filters.py +0 -0
  32. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/sorting.py +0 -0
  33. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/types.py +0 -0
  34. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/swagger.html +0 -0
  35. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/types.py +0 -0
  36. {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: muffin-rest
3
- Version: 5.1.6
3
+ Version: 5.1.8
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
@@ -95,6 +95,7 @@ class PWRESTBase(RESTBase[TVModel], PeeweeOpenAPIMixin):
95
95
  cqs = cast(pw.ModelSelect, self.collection.order_by())
96
96
  if cqs._group_by: # type: ignore[misc]
97
97
  cqs._returning = cqs._group_by # type: ignore[misc]
98
+ cqs._having = None # type: ignore[misc]
98
99
  count = await self.meta.manager.count(cqs)
99
100
 
100
101
  return (
@@ -17,7 +17,10 @@ class EnumField(ma.fields.Field):
17
17
  if value is None:
18
18
  return None
19
19
 
20
- return value.value
20
+ try:
21
+ return value.value
22
+ except AttributeError:
23
+ raise ma.ValidationError(f"{obj}: {attr} value is invalid: {value}") from None
21
24
 
22
25
  def _deserialize(self, value, attr, data, **kwargs):
23
26
  try:
@@ -17,9 +17,11 @@ if TYPE_CHECKING:
17
17
  class PWSort(Sort):
18
18
  """Sorter for Peewee."""
19
19
 
20
- async def apply(self, collection: TVCollection, *, desc: bool = False, **_) -> TVCollection:
20
+ async def apply(self, collection: TVCollection, *, desc: bool = False) -> TVCollection:
21
21
  """Sort the collection."""
22
- return collection.order_by_extend(self.field if not desc else self.field.desc())
22
+ return collection.order_by_extend(
23
+ self.field.asc(nulls="LAST") if not desc else self.field.desc(nulls="LAST")
24
+ )
23
25
 
24
26
 
25
27
  class PWSorting(Sorting):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "muffin-rest"
3
- version = "5.1.6"
3
+ version = "5.1.8"
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"
File without changes
File without changes