internal 1.0.53__py3-none-any.whl → 1.0.55__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.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

internal/model/operate.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import arrow
2
2
  from datetime import datetime
3
- from typing import Optional
3
+ from typing import Optional, Dict
4
4
 
5
5
  import dictdiffer
6
6
  from pydantic import BaseModel
@@ -42,7 +42,8 @@ class Operate(BaseModel):
42
42
  for j in range(0, len(diff[2])):
43
43
  diff_result[diff[0]][diff[2][j][0]] = diff[2][j][1]
44
44
 
45
- return Operate(**diff_result)
45
+ final_diff_result = cls.split_keys(diff_result)
46
+ return Operate(**final_diff_result)
46
47
 
47
48
  @classmethod
48
49
  async def remove_ignore_field(cls, model_dict: dict):
@@ -54,3 +55,21 @@ class Operate(BaseModel):
54
55
  for k, v in model_dict.items():
55
56
  if isinstance(v, datetime):
56
57
  model_dict[k] = arrow.get(v).datetime
58
+
59
+ @classmethod
60
+ def split_keys(cls, diff_result: Dict):
61
+ result = {}
62
+ for key, value in diff_result.items():
63
+ if '.' in key:
64
+ parts = key.split('.')
65
+ current_level = result
66
+ for i, part in enumerate(parts):
67
+ if i == len(parts) - 1:
68
+ current_level[part] = cls.split_keys(value) if isinstance(value, dict) else value
69
+ else:
70
+ if part not in current_level:
71
+ current_level[part] = {}
72
+ current_level = current_level[part]
73
+ else:
74
+ result[key] = cls.split_keys(value) if isinstance(value, dict) else value
75
+ return result
internal/utils.py CHANGED
@@ -47,4 +47,4 @@ def update_dict_with_cast(curr_settings: BaseConfig, new_conf: dict):
47
47
 
48
48
 
49
49
  def sanitize_plate_no(plate_no):
50
- return plate_no.replace(STR_DASH, STR_EMPTY)
50
+ return plate_no.replace(STR_DASH, STR_EMPTY).upper()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 1.0.53
3
+ Version: 1.0.55
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -26,8 +26,8 @@ internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
26
26
  internal/middleware/log_request.py,sha256=bXAxmvvsYDhObXzfUw4ZNreKAWOo8ee_vpb6Xin5ztc,854
27
27
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  internal/model/base_model.py,sha256=NS_GZvw_IqU1aZPHPpyQs6A741O34ybmzVzBPm9nGWU,3014
29
- internal/model/operate.py,sha256=kufXKxDknAneXTL_ycb7THBVvOmXFftYLx18bvdSARI,2004
30
- internal/utils.py,sha256=0SubS0iUhDvjSX1F4TykasA5-enYJzt2VH-f7_0BnjI,1509
31
- internal-1.0.53.dist-info/METADATA,sha256=UbiigwU-ytVxLi4gz2jDidCQvha-zH3LewXzd8OxgRY,625
32
- internal-1.0.53.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
- internal-1.0.53.dist-info/RECORD,,
29
+ internal/model/operate.py,sha256=YZ-sgCx10ln93haJrgU18oeOvINoy5EnOPw1G3-2c4s,2828
30
+ internal/utils.py,sha256=CXYZs4rDDe33Zac27YeknBE4uQN437ys1YAbW3Xeyow,1517
31
+ internal-1.0.55.dist-info/METADATA,sha256=8QiekYi9NZKHJl8Xewfvx6Pk7K1sUhkEmhSGM7VWs_8,625
32
+ internal-1.0.55.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
+ internal-1.0.55.dist-info/RECORD,,