xn-model 1.0.5__tar.gz → 1.0.6__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.5/xn_model.egg-info → xn_model-1.0.6}/PKG-INFO +1 -1
- {xn_model-1.0.5 → xn_model-1.0.6}/x_model/models.py +7 -0
- {xn_model-1.0.5 → xn_model-1.0.6/xn_model.egg-info}/PKG-INFO +1 -1
- {xn_model-1.0.5 → xn_model-1.0.6}/.env.sample +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/.gitignore +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/.pre-commit-config.yaml +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/README.md +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/makefile +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/pyproject.toml +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/setup.cfg +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/tests/__init__.py +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/tests/test_db.py +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/x_model/__init__.py +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/x_model/field.py +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/x_model/func.py +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/xn_model.egg-info/SOURCES.txt +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/xn_model.egg-info/dependency_links.txt +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/xn_model.egg-info/requires.txt +0 -0
- {xn_model-1.0.5 → xn_model-1.0.6}/xn_model.egg-info/top_level.txt +0 -0
|
@@ -45,6 +45,13 @@ class Model(TrtModel):
|
|
|
45
45
|
)
|
|
46
46
|
return cls._pydIn
|
|
47
47
|
|
|
48
|
+
# # # CRUD Methods # # #
|
|
49
|
+
@classmethod
|
|
50
|
+
async def get_one(cls, id_: int) -> PydanticModel:
|
|
51
|
+
if obj := await cls.get_or_none(id=id_):
|
|
52
|
+
return await cls.pyd().from_tortoise_orm(obj)
|
|
53
|
+
raise LookupError(f"{cls.__name__}#{id_} not found")
|
|
54
|
+
|
|
48
55
|
async def one(self) -> PydanticModel:
|
|
49
56
|
return await self.pyd().from_tortoise_orm(self)
|
|
50
57
|
|
|
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
|