rb-commons 0.5.20__py3-none-any.whl → 0.5.22__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.
- rb_commons/orm/managers.py +5 -2
- rb_commons/schemes/jwt.py +1 -1
- {rb_commons-0.5.20.dist-info → rb_commons-0.5.22.dist-info}/METADATA +1 -1
- {rb_commons-0.5.20.dist-info → rb_commons-0.5.22.dist-info}/RECORD +6 -6
- {rb_commons-0.5.20.dist-info → rb_commons-0.5.22.dist-info}/WHEEL +0 -0
- {rb_commons-0.5.20.dist-info → rb_commons-0.5.22.dist-info}/top_level.txt +0 -0
rb_commons/orm/managers.py
CHANGED
@@ -467,7 +467,10 @@ class BaseManager(Generic[ModelType]):
|
|
467
467
|
def sort_by(self, tokens: Sequence[str]) -> "BaseManager[ModelType]":
|
468
468
|
"""
|
469
469
|
Dynamically apply ORDER BY clauses based on a list of "field" or "-field" tokens.
|
470
|
+
Unknown fields are collected for Python-side sorting later.
|
470
471
|
"""
|
472
|
+
self._invalid_sort_tokens = []
|
473
|
+
self._order_by = []
|
471
474
|
model = self.model
|
472
475
|
|
473
476
|
for tok in tokens:
|
@@ -477,8 +480,8 @@ class BaseManager(Generic[ModelType]):
|
|
477
480
|
name = tok.lstrip("-")
|
478
481
|
col = getattr(model, name, None)
|
479
482
|
if col is None:
|
480
|
-
|
481
|
-
|
483
|
+
self._invalid_sort_tokens.append(tok)
|
484
|
+
continue
|
482
485
|
self._order_by.append(direction(col))
|
483
486
|
|
484
487
|
return self
|
rb_commons/schemes/jwt.py
CHANGED
@@ -36,7 +36,7 @@ class Claims(BaseModel):
|
|
36
36
|
except ValueError as e:
|
37
37
|
raise ValueError(f"Invalid user_id format: {e}")
|
38
38
|
|
39
|
-
if raw_claims["x-customer-id"] and raw_claims["x-customer-id"]
|
39
|
+
if raw_claims["x-customer-id"] and raw_claims["x-customer-id"] != 'null':
|
40
40
|
try:
|
41
41
|
raw_claims["x-customer-id"] = int(raw_claims["x-customer-id"])
|
42
42
|
except ValueError as e:
|
@@ -13,16 +13,16 @@ rb_commons/http/consul.py,sha256=Ioq72VD1jGwoC96set7n2SgxN40olzI-myA2lwKkYi4,186
|
|
13
13
|
rb_commons/http/exceptions.py,sha256=EGRMr1cRgiJ9Q2tkfANbf0c6-zzXf1CD6J3cmCaT_FA,1885
|
14
14
|
rb_commons/orm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
rb_commons/orm/exceptions.py,sha256=1aMctiEwrPjyehoXVX1l6ML5ZOhmDkmBISzlTD5ey1Y,509
|
16
|
-
rb_commons/orm/managers.py,sha256=
|
16
|
+
rb_commons/orm/managers.py,sha256=mWLwcJmdQJxtmjQ4ZWCTQRvBF_ukborgyqGW70oodgA,18794
|
17
17
|
rb_commons/orm/services.py,sha256=71eRcJ4TxZvzNz-hLXo12X4U7PGK54ZfbLAb27AjZi8,1589
|
18
18
|
rb_commons/permissions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
rb_commons/permissions/role_permissions.py,sha256=4dV89z6ggzLqCCiFYlMp7kQVJRESu6MHpkT5ZNjLo6A,1096
|
20
20
|
rb_commons/schemes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
rb_commons/schemes/jwt.py,sha256=
|
21
|
+
rb_commons/schemes/jwt.py,sha256=ZKLJ5D3fcEmEKySjzbxEgUcza4K-oPoHr14_Z0r9Yic,2495
|
22
22
|
rb_commons/schemes/pagination.py,sha256=8VZW1wZGJIPR9jEBUgppZUoB4uqP8ORudHkMwvEJSxg,1866
|
23
23
|
rb_commons/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
rb_commons/utils/media.py,sha256=J2Zi0J28DhcVQVzt-myNNVuzj9Msaetul53VjZtdDdc,820
|
25
|
-
rb_commons-0.5.
|
26
|
-
rb_commons-0.5.
|
27
|
-
rb_commons-0.5.
|
28
|
-
rb_commons-0.5.
|
25
|
+
rb_commons-0.5.22.dist-info/METADATA,sha256=a_gA3J0YHykn1itXgtZvolgR73tRAh9mq1mElTlQasY,6571
|
26
|
+
rb_commons-0.5.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
27
|
+
rb_commons-0.5.22.dist-info/top_level.txt,sha256=HPx_WAYo3_fbg1WCeGHsz3wPGio1ucbnrlm2lmqlJog,11
|
28
|
+
rb_commons-0.5.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|