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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xn-model
3
- Version: 0.11.2
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, model
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, model)), AsyncpgDBClient), "DB corrupt"
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
- path = 8
24
+ body = 8
25
25
  query = 9
26
- body = 10
27
- method = 11
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.2
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
@@ -9,7 +9,7 @@ tests/test_db.py
9
9
  x_model/__init__.py
10
10
  x_model/field.py
11
11
  x_model/func.py
12
- x_model/model.py
12
+ x_model/models.py
13
13
  x_model/pydantic.py
14
14
  xn_model.egg-info/PKG-INFO
15
15
  xn_model.egg-info/SOURCES.txt
@@ -1,8 +1,7 @@
1
1
  tortoise-orm[accel,asyncpg]
2
- python-dotenv
3
2
 
4
3
  [dev]
5
4
  pytest
5
+ python-dotenv
6
6
  build
7
7
  twine
8
- setuptools_scm
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