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.
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/PKG-INFO +1 -1
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/handler.py +1 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/schemas.py +4 -1
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/sorting.py +4 -2
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/pyproject.toml +1 -1
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/LICENSE +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/README.rst +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/__init__.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/api.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/errors.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/filters.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/handler.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/__init__.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/filters.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/schema.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/sorting.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/types.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/mongo/utils.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/openapi.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/options.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/__init__.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/filters.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/openapi.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/options.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/types.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/peewee/utils.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/py.typed +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/redoc.html +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sorting.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/__init__.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/filters.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/sorting.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/sqlalchemy/types.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/swagger.html +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/types.py +0 -0
- {muffin_rest-5.1.6 → muffin_rest-5.1.8}/muffin_rest/utils.py +0 -0
|
@@ -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
|
-
|
|
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
|
|
20
|
+
async def apply(self, collection: TVCollection, *, desc: bool = False) -> TVCollection:
|
|
21
21
|
"""Sort the collection."""
|
|
22
|
-
return collection.order_by_extend(
|
|
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):
|
|
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
|