internal 1.0.23__py3-none-any.whl → 1.0.25__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/base_factory.py CHANGED
@@ -38,6 +38,12 @@ class BaseFactory(metaclass=ABCMeta):
38
38
  Each factory should define what model it wants.
39
39
  """
40
40
 
41
+ @abstractmethod
42
+ async def init_state_cache(self, app, app_config):
43
+ """
44
+ Each factory should define what model it wants.
45
+ """
46
+
41
47
  @abstractmethod
42
48
  @lru_cache()
43
49
  def get_app_config(self):
@@ -86,6 +92,8 @@ class BaseFactory(metaclass=ABCMeta):
86
92
  document_model_list = await self.get_document_model_list()
87
93
  await init_beanie(database=app.state.db.get_database(), document_models=document_model_list)
88
94
  app.state.logger.info("Database connected")
95
+ await self.init_state_cache(app, self.get_app_config())
96
+ app.state.logger.info("Initialization state cache done")
89
97
 
90
98
  @app.on_event("shutdown")
91
99
  async def shutdown_db_client():
@@ -63,7 +63,7 @@ class InternalBaseDocument(Document):
63
63
  delta_dict = schema.model_dump()
64
64
 
65
65
  for key, value in delta_dict.items():
66
- if value is not None and hasattr(self, key):
66
+ if hasattr(self, key):
67
67
  setattr(self, key, value)
68
68
 
69
69
  operate = await Operate.generate_operate(original_model.model_dump(), self.model_dump())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 1.0.23
3
+ Version: 1.0.25
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,6 +1,6 @@
1
1
  internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  internal/base_config.py,sha256=5-s2muyaLOGKhrq8kVqq0qaXFD09FrcQZCAFmw1FQtk,1755
3
- internal/base_factory.py,sha256=Cxi0NQMiAiPNcbsyXqo_Ilc91TU3KbnLL1F6RIG9L08,7854
3
+ internal/base_factory.py,sha256=OeSgcQgObjYkLMjgG8LY4V2QDRd0esL1riQxg8cxnsk,8147
4
4
  internal/common_enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  internal/common_enum/contact_type.py,sha256=7QkTQ71UxpaT1YHI40FpjmLz3r-UbRU-sd0m5ajH1as,142
6
6
  internal/common_enum/description_type.py,sha256=kGwkFQh6dMnjDl6ipWYpA-qbNRrhEpnPq3NleTsNwwk,118
@@ -24,9 +24,9 @@ internal/interface/base_interface.py,sha256=R5MmO5oa5-ORPV_adkegLVCwsVio2zFOuQFG
24
24
  internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  internal/middleware/log_request.py,sha256=bXAxmvvsYDhObXzfUw4ZNreKAWOo8ee_vpb6Xin5ztc,854
26
26
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- internal/model/base_model.py,sha256=wnAKz21bXcbR4QqENc1_hKbUkzc8a8aT8oyhS9WT7kw,3032
27
+ internal/model/base_model.py,sha256=Oc33c8AnPQcJEiEMQM_g3KT1b7iaa1IxgBMavds-_Ns,3010
28
28
  internal/model/operate.py,sha256=luEoP_Asvso_11qz1SAE1Kn5KxAnDRptM0VylC5tNik,1493
29
29
  internal/utils.py,sha256=0SubS0iUhDvjSX1F4TykasA5-enYJzt2VH-f7_0BnjI,1509
30
- internal-1.0.23.dist-info/METADATA,sha256=jakJGXVBUFO8w6Ht_ofDgKoMgjSKpqd1FuUuH8hPtEo,625
31
- internal-1.0.23.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- internal-1.0.23.dist-info/RECORD,,
30
+ internal-1.0.25.dist-info/METADATA,sha256=_fX7qeCeR85TG7TRn5ksQHB26LNfl4YcdA4ZqvvcBvk,625
31
+ internal-1.0.25.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
+ internal-1.0.25.dist-info/RECORD,,