xn-model 1.0.8__py3-none-any.whl → 1.0.10__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 +2 -2
- x_model/types.py +8 -6
- {xn_model-1.0.8.dist-info → xn_model-1.0.10.dist-info}/METADATA +1 -1
- xn_model-1.0.10.dist-info/RECORD +9 -0
- xn_model-1.0.8.dist-info/RECORD +0 -9
- {xn_model-1.0.8.dist-info → xn_model-1.0.10.dist-info}/WHEEL +0 -0
- {xn_model-1.0.8.dist-info → xn_model-1.0.10.dist-info}/top_level.txt +0 -0
x_model/models.py
CHANGED
|
@@ -28,13 +28,13 @@ class Model(TortModel):
|
|
|
28
28
|
@classmethod
|
|
29
29
|
def out_type(cls):
|
|
30
30
|
if not cls._out_type:
|
|
31
|
-
cls.
|
|
31
|
+
cls._out_type = pydantic_model_creator(cls, name=cls.__name__ + "Out")
|
|
32
32
|
return cls._out_type
|
|
33
33
|
|
|
34
34
|
@classmethod
|
|
35
35
|
def in_type(cls):
|
|
36
36
|
if not cls._in_type:
|
|
37
|
-
cls.
|
|
37
|
+
cls._in_type = pydantic_model_creator(
|
|
38
38
|
cls, name=cls.__name__ + "In", exclude_readonly=True, meta_override=cls.PydanticMetaIn
|
|
39
39
|
)
|
|
40
40
|
return cls._in_type
|
x_model/types.py
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import ClassVar
|
|
2
|
+
from msgspec import Struct
|
|
3
|
+
from msgspec.structs import asdict
|
|
2
4
|
|
|
3
5
|
|
|
4
|
-
class New(
|
|
5
|
-
_unq:
|
|
6
|
+
class New(Struct):
|
|
7
|
+
_unq: ClassVar[tuple[str]] = ()
|
|
6
8
|
|
|
7
|
-
def df_unq(self) -> dict:
|
|
8
|
-
d = self.
|
|
9
|
+
def df_unq(self, frozen_props: tuple[str] = ()) -> dict:
|
|
10
|
+
d = {k: v for k, v in asdict(self).items() if v is not None or k in frozen_props}
|
|
9
11
|
return {**{k: d.pop(k) for k in set(self._unq) & d.keys()}, "defaults": d}
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class Upd(New):
|
|
13
|
-
_unq
|
|
15
|
+
_unq = ("id",)
|
|
14
16
|
|
|
15
17
|
id: int
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
x_model/__init__.py,sha256=JRsYD3P-8pHpEkCUgy6GuodkT7ZaY1AEeEK1CbpgZw4,428
|
|
2
|
+
x_model/field.py,sha256=w5BAoNA33a-uROaExx5Pr3jYQnUMKIYFYcPTjdBlx3M,2784
|
|
3
|
+
x_model/func.py,sha256=E7jDoHJGaFpKvxbHnT_lyBxUZeMo-GRd5gv9dLw7B9s,289
|
|
4
|
+
x_model/models.py,sha256=-dhEPBoOIcMvkWayjgOBt9xYiOalv8ZIM9bmFziVdzM,2710
|
|
5
|
+
x_model/types.py,sha256=FEb0dPkmeU7sz_To1iT3-yk4UOD7S8xfiHGoYIFEpk0,432
|
|
6
|
+
xn_model-1.0.10.dist-info/METADATA,sha256=4NkzzJAq2EuhxVlBI0Tj6MCsdjoKoTuUpEgbXfxEWps,962
|
|
7
|
+
xn_model-1.0.10.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
8
|
+
xn_model-1.0.10.dist-info/top_level.txt,sha256=QCYyfv5AA_8jPPtCpShkBXzQRUCGuuW7Ro0mqysDE8E,8
|
|
9
|
+
xn_model-1.0.10.dist-info/RECORD,,
|
xn_model-1.0.8.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
x_model/__init__.py,sha256=JRsYD3P-8pHpEkCUgy6GuodkT7ZaY1AEeEK1CbpgZw4,428
|
|
2
|
-
x_model/field.py,sha256=w5BAoNA33a-uROaExx5Pr3jYQnUMKIYFYcPTjdBlx3M,2784
|
|
3
|
-
x_model/func.py,sha256=E7jDoHJGaFpKvxbHnT_lyBxUZeMo-GRd5gv9dLw7B9s,289
|
|
4
|
-
x_model/models.py,sha256=MxhGgmmiinkQ6LSFOnnwjcIeDsiyQNjHhNagZVap1wM,2701
|
|
5
|
-
x_model/types.py,sha256=m7B5XOQvXpOMe8GpO0IizmQLAMd-UzMa9t0hodnfCXw,301
|
|
6
|
-
xn_model-1.0.8.dist-info/METADATA,sha256=rIaxH2A7c2gl9hRiBvAosob1xN4Jbf0MqMMOrLJFEZw,961
|
|
7
|
-
xn_model-1.0.8.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
8
|
-
xn_model-1.0.8.dist-info/top_level.txt,sha256=QCYyfv5AA_8jPPtCpShkBXzQRUCGuuW7Ro0mqysDE8E,8
|
|
9
|
-
xn_model-1.0.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|