muffin-rest 7.3.3__tar.gz → 7.3.5__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-7.3.3 → muffin_rest-7.3.5}/PKG-INFO +1 -1
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/filters.py +1 -0
- muffin_rest-7.3.5/muffin_rest/peewee/schemas.py +17 -0
- {muffin_rest-7.3.3/muffin_rest/peewee → muffin_rest-7.3.5/muffin_rest}/schemas.py +0 -14
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/pyproject.toml +1 -1
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/LICENSE +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/README.rst +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/__init__.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/api.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/errors.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/filters.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/handler.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/marshmallow.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/mongo/__init__.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/mongo/filters.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/mongo/schema.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/mongo/sorting.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/mongo/types.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/mongo/utils.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/openapi.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/options.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/__init__.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/handler.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/openapi.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/options.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/sorting.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/types.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/peewee/utils.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/py.typed +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/redoc.html +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/sorting.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/sqlalchemy/__init__.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/sqlalchemy/filters.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/sqlalchemy/sorting.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/sqlalchemy/types.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/swagger.html +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/types.py +0 -0
- {muffin_rest-7.3.3 → muffin_rest-7.3.5}/muffin_rest/utils.py +0 -0
|
@@ -25,6 +25,7 @@ class PWFilter(Filter):
|
|
|
25
25
|
operators["$ends"] = lambda f, v: f.endswith(v)
|
|
26
26
|
operators["$between"] = lambda f, v: f.between(*v)
|
|
27
27
|
operators["$regexp"] = lambda f, v: f.regexp(v)
|
|
28
|
+
operators["$null"] = lambda f, v: f.is_null(v)
|
|
28
29
|
operators["$or"] = lambda col, value: reduce(operator.or_, [op(col, val) for op, val in value])
|
|
29
30
|
operators["$and"] = lambda col, value: reduce(
|
|
30
31
|
operator.and_, [op(col, val) for op, val in value]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import marshmallow as ma
|
|
2
|
+
from marshmallow_peewee import DefaultConverter
|
|
3
|
+
from muffin_peewee.fields import IntEnumField, StrEnumField, URLField
|
|
4
|
+
|
|
5
|
+
from muffin_rest.schemas import EnumField
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@DefaultConverter.register(StrEnumField)
|
|
9
|
+
@DefaultConverter.register(IntEnumField)
|
|
10
|
+
def build_field(field, opts, **params):
|
|
11
|
+
params.pop("validate", None)
|
|
12
|
+
return EnumField(field.enum, **params)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
DefaultConverter.register(URLField, ma.fields.Url)
|
|
16
|
+
|
|
17
|
+
# ruff: noqa: ARG001, ARG002
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import marshmallow as ma
|
|
2
|
-
from marshmallow_peewee import DefaultConverter
|
|
3
|
-
from muffin_peewee.fields import IntEnumField, StrEnumField, URLField
|
|
4
2
|
|
|
5
3
|
|
|
6
4
|
class EnumField(ma.fields.Field):
|
|
@@ -27,15 +25,3 @@ class EnumField(ma.fields.Field):
|
|
|
27
25
|
return self.enum(value)
|
|
28
26
|
except ValueError as error:
|
|
29
27
|
raise self.make_error("unknown", choices=self.choices_text) from error
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@DefaultConverter.register(StrEnumField)
|
|
33
|
-
@DefaultConverter.register(IntEnumField)
|
|
34
|
-
def build_field(field, opts, **params):
|
|
35
|
-
params.pop("validate", None)
|
|
36
|
-
return EnumField(field.enum, **params)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
DefaultConverter.register(URLField, ma.fields.Url)
|
|
40
|
-
|
|
41
|
-
# ruff: noqa: ARG001, ARG002
|
|
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
|