muffin-rest 5.1.4__py3-none-any.whl → 5.1.5__py3-none-any.whl
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/peewee/sorting.py +1 -1
- muffin_rest/peewee/utils.py +2 -2
- {muffin_rest-5.1.4.dist-info → muffin_rest-5.1.5.dist-info}/METADATA +1 -1
- {muffin_rest-5.1.4.dist-info → muffin_rest-5.1.5.dist-info}/RECORD +6 -6
- {muffin_rest-5.1.4.dist-info → muffin_rest-5.1.5.dist-info}/LICENSE +0 -0
- {muffin_rest-5.1.4.dist-info → muffin_rest-5.1.5.dist-info}/WHEEL +0 -0
muffin_rest/peewee/sorting.py
CHANGED
|
@@ -47,7 +47,7 @@ class PWSorting(Sorting):
|
|
|
47
47
|
name = obj
|
|
48
48
|
field = meta.pop("field", None) or name
|
|
49
49
|
if isinstance(field, str):
|
|
50
|
-
field = get_model_field_by_name(handler, field)
|
|
50
|
+
field = get_model_field_by_name(handler, field, stacklevel=6)
|
|
51
51
|
|
|
52
52
|
if field:
|
|
53
53
|
sort = self.MUTATE_CLASS(name, field=field, **meta)
|
muffin_rest/peewee/utils.py
CHANGED
|
@@ -8,7 +8,7 @@ if TYPE_CHECKING:
|
|
|
8
8
|
from peewee import Field
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def get_model_field_by_name(handler, name: str) -> Optional[Field]:
|
|
11
|
+
def get_model_field_by_name(handler, name: str, stacklevel=5) -> Optional[Field]:
|
|
12
12
|
"""Get model field by name."""
|
|
13
13
|
fields = handler.meta.model._meta.fields
|
|
14
14
|
candidate = fields.get(name)
|
|
@@ -22,6 +22,6 @@ def get_model_field_by_name(handler, name: str) -> Optional[Field]:
|
|
|
22
22
|
warn(
|
|
23
23
|
f"{handler.__qualname__} {handler.meta.model} has no field {name}",
|
|
24
24
|
category=RuntimeWarning,
|
|
25
|
-
stacklevel=
|
|
25
|
+
stacklevel=stacklevel,
|
|
26
26
|
)
|
|
27
27
|
return None
|
|
@@ -17,9 +17,9 @@ muffin_rest/peewee/handler.py,sha256=ipIcOmCgHpqWJevWHm9xxZ2GsZPUV7dc9QCmu7bvaLM
|
|
|
17
17
|
muffin_rest/peewee/openapi.py,sha256=ZZuh7nJVuK9cTJqtOJ_XASe9iJgter-xIjj9YJ8xszI,1111
|
|
18
18
|
muffin_rest/peewee/options.py,sha256=02E8yOXHaHl0smKV8qI6er7YS3IcuroDPl7GR_YuLjo,1489
|
|
19
19
|
muffin_rest/peewee/schemas.py,sha256=GYex652UOBoFBvpkqDupBe8kXJHIEBF2diZPjE-BXj4,1076
|
|
20
|
-
muffin_rest/peewee/sorting.py,sha256=
|
|
20
|
+
muffin_rest/peewee/sorting.py,sha256=7in0ICivfZbfNIacA3eo9o5cKdwNJZFp1Vl5mIqvQyk,1848
|
|
21
21
|
muffin_rest/peewee/types.py,sha256=cgCXhpGHkImKwudA1lulZHz5oJswHH168AiW5MhZRCM,155
|
|
22
|
-
muffin_rest/peewee/utils.py,sha256
|
|
22
|
+
muffin_rest/peewee/utils.py,sha256=wXeneVE1IZl1ROnY28re73H62Y1_tEmoEQYzPhuOyBI,702
|
|
23
23
|
muffin_rest/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
muffin_rest/redoc.html,sha256=GtuHIMvTuSi8Ro6bgI-G8VB94AljMyfjcZseqtBmGCY,559
|
|
25
25
|
muffin_rest/sorting.py,sha256=x-3UE9MMV7RzmNDTIgsM1RDVd42mPeq03LbkaaKuM4g,2803
|
|
@@ -30,7 +30,7 @@ muffin_rest/sqlalchemy/types.py,sha256=JnIw44XJ2ClWzOv-mTUrvFw1JPxAlvdX_jf7r4zau
|
|
|
30
30
|
muffin_rest/swagger.html,sha256=2uGLu_KpkYf925KnDKHBJmV9pm6OHn5C3BWScESsUS8,1736
|
|
31
31
|
muffin_rest/types.py,sha256=vy55ShzMcvs9zXjFpdjWlagv09dMrcmxb2-U4hTL3NM,521
|
|
32
32
|
muffin_rest/utils.py,sha256=-nf6WCGFlVoOcBT-n6eiIpbZSmPY8ynm2UlMelgmn8o,2059
|
|
33
|
-
muffin_rest-5.1.
|
|
34
|
-
muffin_rest-5.1.
|
|
35
|
-
muffin_rest-5.1.
|
|
36
|
-
muffin_rest-5.1.
|
|
33
|
+
muffin_rest-5.1.5.dist-info/LICENSE,sha256=xHPkOZhjyKBMOwXpWn9IB_BVLjrrMxv2M9slKkHj2hM,1082
|
|
34
|
+
muffin_rest-5.1.5.dist-info/METADATA,sha256=3PctsieZjB1spGYPjeyzz8QpkATgGE0t44yztujeQHA,4126
|
|
35
|
+
muffin_rest-5.1.5.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
36
|
+
muffin_rest-5.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|