xn-model 1.0.9__tar.gz → 1.0.11__tar.gz
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.
- {xn_model-1.0.9/xn_model.egg-info → xn_model-1.0.11}/PKG-INFO +1 -1
- xn_model-1.0.11/x_model/types.py +16 -0
- {xn_model-1.0.9 → xn_model-1.0.11/xn_model.egg-info}/PKG-INFO +1 -1
- xn_model-1.0.9/x_model/types.py +0 -15
- {xn_model-1.0.9 → xn_model-1.0.11}/.env.sample +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/.gitignore +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/.pre-commit-config.yaml +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/README.md +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/makefile +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/pyproject.toml +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/setup.cfg +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/tests/__init__.py +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/tests/test_db.py +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/x_model/__init__.py +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/x_model/field.py +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/x_model/func.py +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/x_model/models.py +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/xn_model.egg-info/SOURCES.txt +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/xn_model.egg-info/dependency_links.txt +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/xn_model.egg-info/requires.txt +0 -0
- {xn_model-1.0.9 → xn_model-1.0.11}/xn_model.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import ClassVar
|
|
2
|
+
from pydantic import BaseModel
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class New(BaseModel):
|
|
6
|
+
_unq: ClassVar[tuple[str]] = ()
|
|
7
|
+
|
|
8
|
+
def df_unq(self) -> dict:
|
|
9
|
+
d = {k: v for k, v in self.model_dump(exclude_none=True).items()}
|
|
10
|
+
return {**{k: d.pop(k, None) for k in set(self._unq)}, "defaults": d}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Upd(New):
|
|
14
|
+
_unq = ("id",)
|
|
15
|
+
|
|
16
|
+
id: int
|
xn_model-1.0.9/x_model/types.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class New(BaseModel):
|
|
5
|
-
_unq: list[str] = []
|
|
6
|
-
|
|
7
|
-
def df_unq(self) -> dict:
|
|
8
|
-
d = self.model_dump(exclude_none=True)
|
|
9
|
-
return {**{k: d.pop(k) for k in set(self._unq) & d.keys()}, "defaults": d}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class Upd(New):
|
|
13
|
-
_unq: list[str] = ["id"]
|
|
14
|
-
|
|
15
|
-
id: int
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|