xn-model 1.0.2__py3-none-any.whl → 1.0.3__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.
x_model/models.py CHANGED
@@ -21,6 +21,7 @@ class TsTrait:
21
21
  class Model(BaseModel):
22
22
  id: int = IntField(True)
23
23
 
24
+ _pyd: type[PydanticModel] = None
24
25
  _name: tuple[str] = ("name",)
25
26
  _sorts: tuple[str] = ("-id",)
26
27
 
@@ -29,7 +30,9 @@ class Model(BaseModel):
29
30
 
30
31
  @classmethod
31
32
  def pyd(cls):
32
- return pydantic_model_creator(cls, name=cls.__name__)
33
+ if not cls._pyd:
34
+ cls._pyd = pydantic_model_creator(cls, name=cls.__name__)
35
+ return cls._pyd
33
36
 
34
37
  # # # CRUD Methods # # #
35
38
  @classmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: xn-model
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Base model for xn-api
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: MIT
@@ -1,9 +1,9 @@
1
1
  x_model/__init__.py,sha256=JgpONZwWeYiV4mzk0nT8PM4ZzTSCSAGy4PV2G2ZIW04,933
2
2
  x_model/field.py,sha256=S461M94ryQG7yu8lreXtWnZo3YdCP97xhbcCJ3BzXsY,2751
3
3
  x_model/func.py,sha256=E7jDoHJGaFpKvxbHnT_lyBxUZeMo-GRd5gv9dLw7B9s,289
4
- x_model/models.py,sha256=XZu7jWf0Wl5JiHvS222iumMk3eJLuQBkhOVfq-46qd8,2141
4
+ x_model/models.py,sha256=Qd-lB_gWOENCmmAkTf_CBKvWK1o-OIq1FGduHsgdcMI,2235
5
5
  x_model/pydantic.py,sha256=18O4yFvYDyZaSqIaOKcZhQRpIBM2o73DNlqrXvU_4XM,342
6
- xn_model-1.0.2.dist-info/METADATA,sha256=0B-FErvCVRVC13r_j1TMqZrcQ6KssyvNoO6OlsnArsw,961
7
- xn_model-1.0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
8
- xn_model-1.0.2.dist-info/top_level.txt,sha256=QCYyfv5AA_8jPPtCpShkBXzQRUCGuuW7Ro0mqysDE8E,8
9
- xn_model-1.0.2.dist-info/RECORD,,
6
+ xn_model-1.0.3.dist-info/METADATA,sha256=gyHOjZeJbyjP2iVtGnZ6zSeBNjFUyjlEggJzJXvv7m8,961
7
+ xn_model-1.0.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
8
+ xn_model-1.0.3.dist-info/top_level.txt,sha256=QCYyfv5AA_8jPPtCpShkBXzQRUCGuuW7Ro0mqysDE8E,8
9
+ xn_model-1.0.3.dist-info/RECORD,,