xn-model 0.11.2__tar.gz → 0.11.4__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-0.11.2/xn_model.egg-info → xn_model-0.11.4}/PKG-INFO +2 -3
- {xn_model-0.11.2 → xn_model-0.11.4}/pyproject.toml +3 -6
- {xn_model-0.11.2 → xn_model-0.11.4}/tests/test_db.py +2 -2
- {xn_model-0.11.2 → xn_model-0.11.4}/x_model/__init__.py +4 -3
- xn_model-0.11.2/x_model/model.py → xn_model-0.11.4/x_model/models.py +1 -1
- {xn_model-0.11.2 → xn_model-0.11.4/xn_model.egg-info}/PKG-INFO +2 -3
- {xn_model-0.11.2 → xn_model-0.11.4}/xn_model.egg-info/SOURCES.txt +1 -1
- {xn_model-0.11.2 → xn_model-0.11.4}/xn_model.egg-info/requires.txt +1 -2
- {xn_model-0.11.2 → xn_model-0.11.4}/.env.sample +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/.gitignore +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/.pre-commit-config.yaml +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/README.md +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/makefile +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/setup.cfg +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/tests/__init__.py +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/x_model/field.py +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/x_model/func.py +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/x_model/pydantic.py +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/xn_model.egg-info/dependency_links.txt +0 -0
- {xn_model-0.11.2 → xn_model-0.11.4}/xn_model.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xn-model
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.4
|
|
4
4
|
Summary: Base model for xn-api
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -10,12 +10,11 @@ Keywords: tortoise,model,crud,generator,api,admin
|
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: tortoise-orm[accel,asyncpg]
|
|
13
|
-
Requires-Dist: python-dotenv
|
|
14
13
|
Provides-Extra: dev
|
|
15
14
|
Requires-Dist: pytest; extra == "dev"
|
|
15
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
16
16
|
Requires-Dist: build; extra == "dev"
|
|
17
17
|
Requires-Dist: twine; extra == "dev"
|
|
18
|
-
Requires-Dist: setuptools_scm; extra == "dev"
|
|
19
18
|
|
|
20
19
|
## INSTALL
|
|
21
20
|
```bash
|
|
@@ -4,10 +4,7 @@ requires-python = ">=3.12"
|
|
|
4
4
|
authors = [
|
|
5
5
|
{name = "Mike Artemiev", email = "mixartemev@gmail.com"},
|
|
6
6
|
]
|
|
7
|
-
dependencies = [
|
|
8
|
-
'tortoise-orm[accel,asyncpg]',
|
|
9
|
-
"python-dotenv"
|
|
10
|
-
]
|
|
7
|
+
dependencies = ['tortoise-orm[accel,asyncpg]']
|
|
11
8
|
keywords = ["tortoise", "model", "crud", "generator", "api", "admin"]
|
|
12
9
|
description = 'Base model for xn-api'
|
|
13
10
|
readme = "README.md"
|
|
@@ -32,9 +29,9 @@ local_scheme = "no-local-version"
|
|
|
32
29
|
[project.optional-dependencies]
|
|
33
30
|
dev = [
|
|
34
31
|
"pytest",
|
|
32
|
+
"python-dotenv",
|
|
35
33
|
"build",
|
|
36
|
-
"twine"
|
|
37
|
-
"setuptools_scm",
|
|
34
|
+
"twine"
|
|
38
35
|
]
|
|
39
36
|
|
|
40
37
|
[tool.ruff]
|
|
@@ -3,7 +3,7 @@ from os import getenv as env
|
|
|
3
3
|
from dotenv import load_dotenv
|
|
4
4
|
from tortoise.backends.asyncpg import AsyncpgDBClient
|
|
5
5
|
|
|
6
|
-
from x_model import init_db,
|
|
6
|
+
from x_model import init_db, models
|
|
7
7
|
|
|
8
8
|
load_dotenv()
|
|
9
9
|
|
|
@@ -11,4 +11,4 @@ PG_DSN = f"postgres://{env('POSTGRES_USER')}:{env('POSTGRES_PASSWORD')}@{env('PO
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def test_init_db():
|
|
14
|
-
assert isinstance(run(init_db(PG_DSN,
|
|
14
|
+
assert isinstance(run(init_db(PG_DSN, models)), AsyncpgDBClient), "DB corrupt"
|
|
@@ -21,11 +21,12 @@ async def init_db(dsn: str, models: ModuleType, create_tables: bool = False) ->
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class FailReason(IntEnum):
|
|
24
|
-
|
|
24
|
+
body = 8
|
|
25
25
|
query = 9
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
path = 10
|
|
27
|
+
host = 11
|
|
28
28
|
protocol = 12
|
|
29
|
+
method = 13
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
class HTTPException(BaseHTTPException):
|
|
@@ -104,7 +104,7 @@ class Model(BaseModel):
|
|
|
104
104
|
|
|
105
105
|
@classmethod
|
|
106
106
|
def pyd(cls) -> type[PydanticModel]:
|
|
107
|
-
cls._pyd = cls._pyd or pydantic_model_creator(cls)
|
|
107
|
+
cls._pyd = cls._pyd or pydantic_model_creator(cls, name=cls.__name__)
|
|
108
108
|
return cls._pyd
|
|
109
109
|
|
|
110
110
|
@classmethod
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xn-model
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.4
|
|
4
4
|
Summary: Base model for xn-api
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -10,12 +10,11 @@ Keywords: tortoise,model,crud,generator,api,admin
|
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: tortoise-orm[accel,asyncpg]
|
|
13
|
-
Requires-Dist: python-dotenv
|
|
14
13
|
Provides-Extra: dev
|
|
15
14
|
Requires-Dist: pytest; extra == "dev"
|
|
15
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
16
16
|
Requires-Dist: build; extra == "dev"
|
|
17
17
|
Requires-Dist: twine; extra == "dev"
|
|
18
|
-
Requires-Dist: setuptools_scm; extra == "dev"
|
|
19
18
|
|
|
20
19
|
## INSTALL
|
|
21
20
|
```bash
|
|
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
|