arpakitlib 1.6.3__py3-none-any.whl → 1.6.32__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.
@@ -25,24 +25,31 @@ class BaseDBM(DeclarativeBase):
25
25
  self._bus_data = {}
26
26
  return self._bus_data
27
27
 
28
- def simple_dict(self) -> dict[str, Any]:
29
- return {c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs}
28
+ def simple_dict(self, *, include_sd_properties: bool = True) -> dict[str, Any]:
29
+ res = {c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs}
30
30
 
31
- def simple_json(self) -> str:
32
- return safely_transfer_to_json_str(self.simple_dict())
31
+ if include_sd_properties:
32
+ for attr_name in dir(self):
33
+ if attr_name.startswith("sdp_") and isinstance(getattr(type(self), attr_name, None), property):
34
+ res[attr_name.removesuffix("sdp_")] = getattr(self, attr_name)
35
+
36
+ return res
37
+
38
+ def simple_json(self, *, include_sd_properties: bool = True) -> str:
39
+ return safely_transfer_to_json_str(self.simple_dict(include_sd_properties=include_sd_properties))
33
40
 
34
41
 
35
42
  class SimpleDBM(BaseDBM):
36
43
  __abstract__ = True
37
44
 
38
45
  id: Mapped[int] = mapped_column(
39
- INTEGER, primary_key=True, autoincrement=True, sort_order=0, nullable=False
46
+ INTEGER, primary_key=True, autoincrement=True, sort_order=-3, nullable=False
40
47
  )
41
48
  long_id: Mapped[str] = mapped_column(
42
- TEXT, insert_default=uuid4, unique=True, sort_order=1, nullable=False
49
+ TEXT, insert_default=uuid4, unique=True, sort_order=-2, nullable=False
43
50
  )
44
51
  creation_dt: Mapped[datetime] = mapped_column(
45
- TIMESTAMP(timezone=True), insert_default=now_utc_dt, index=True, sort_order=2, nullable=False
52
+ TIMESTAMP(timezone=True), insert_default=now_utc_dt, index=True, sort_order=-1, nullable=False
46
53
  )
47
54
 
48
55
  def __repr__(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.6.3
3
+ Version: 1.6.32
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -56,15 +56,15 @@ arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJ
56
56
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
57
57
  arpakitlib/ar_schedule_uust_api_client_util.py,sha256=NpCN8GT96aPvE3Lc-IRn653abjI95CmOqNc4pbHIWxo,5780
58
58
  arpakitlib/ar_sleep_util.py,sha256=9ZN4Qo4eZ_q3hjM7vNBQjFRcH-9-sqv3QLSjnxVJE90,1405
59
- arpakitlib/ar_sqlalchemy_model_util.py,sha256=td_V-K7qxIG-mRXD24yTKNZYx2tOjIAXcmBsw0Rkix0,4366
59
+ arpakitlib/ar_sqlalchemy_model_util.py,sha256=ttdgOwQfoHTKqgivBtXoSbJoBCASHDjLEFK5tJ9kNNE,4779
60
60
  arpakitlib/ar_sqlalchemy_util.py,sha256=3jKHu5aUFPUQ492dWaisN0Y_-r2Pif16SfNawrQ_6xY,4012
61
61
  arpakitlib/ar_ssh_util.py,sha256=jlnss4V4pziBN1rBzoK_lDiWm6nMOqGXfa6NFJSKH-Y,6796
62
62
  arpakitlib/ar_str_util.py,sha256=xSEzmsDvRiZVaxyqFFjcgzpphktCbXg2FHcvsd1DYpA,1885
63
63
  arpakitlib/ar_type_util.py,sha256=I6jbTz7_dxR1lkhz1JfUb5ZyLLdXVhG_-hzjdgT6N6s,1932
64
64
  arpakitlib/ar_yookassa_api_client_util.py,sha256=5GMvu8paByni8buhc1vpHB7n6oXe0gPfj1LSvnyZCrQ,5307
65
65
  arpakitlib/ar_zabbix_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
66
- arpakitlib-1.6.3.dist-info/LICENSE,sha256=1jqWIkbnMxDfs_i0SXP5qbV6PHjBr1g8506oW7uPjfg,11347
67
- arpakitlib-1.6.3.dist-info/METADATA,sha256=tuCgfzmnft8cUqIvsXNIh_goZIK6MjxvL03g6bcv86g,2319
68
- arpakitlib-1.6.3.dist-info/NOTICE,sha256=wHwmiq3wExfFfgMsE5U5TOBP9_l72ocIG82KurEels0,43
69
- arpakitlib-1.6.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
70
- arpakitlib-1.6.3.dist-info/RECORD,,
66
+ arpakitlib-1.6.32.dist-info/LICENSE,sha256=1jqWIkbnMxDfs_i0SXP5qbV6PHjBr1g8506oW7uPjfg,11347
67
+ arpakitlib-1.6.32.dist-info/METADATA,sha256=GTVJVV5RZ1XIyDTZdJfOWkrpddmLLZO1hQGtjOVdobk,2320
68
+ arpakitlib-1.6.32.dist-info/NOTICE,sha256=wHwmiq3wExfFfgMsE5U5TOBP9_l72ocIG82KurEels0,43
69
+ arpakitlib-1.6.32.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
70
+ arpakitlib-1.6.32.dist-info/RECORD,,