ohmyapi 0.2.8__tar.gz → 0.3.0__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.
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/PKG-INFO +1 -1
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/pyproject.toml +1 -1
- ohmyapi-0.3.0/src/ohmyapi/__init__.py +1 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/db/model/model.py +17 -0
- ohmyapi-0.2.8/src/ohmyapi/__init__.py +0 -1
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/README.md +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/__main__.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/auth/__init__.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/auth/models.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/auth/permissions.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/auth/routes.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/demo/__init__.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/demo/models.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/builtin/demo/routes.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/cli.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/__init__.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/runtime.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/scaffolding.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/app/__init__.py.j2 +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/app/models.py.j2 +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/app/routes.py.j2 +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/docker/Dockerfile +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/docker/docker-compose.yml +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/project/README.md.j2 +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/project/pyproject.toml.j2 +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/core/templates/project/settings.py.j2 +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/db/__init__.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/db/exceptions.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/db/model/__init__.py +0 -0
- {ohmyapi-0.2.8 → ohmyapi-0.3.0}/src/ohmyapi/router.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ohmyapi
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: Django-flavored scaffolding and management layer around FastAPI, Pydantic, TortoiseORM and Aerich migrations
|
5
5
|
License-Expression: MIT
|
6
6
|
Keywords: fastapi,tortoise,orm,pydantic,async,web-framework
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "ohmyapi"
|
3
|
-
version = "0.
|
3
|
+
version = "0.3.0"
|
4
4
|
description = "Django-flavored scaffolding and management layer around FastAPI, Pydantic, TortoiseORM and Aerich migrations"
|
5
5
|
license = "MIT"
|
6
6
|
keywords = ["fastapi", "tortoise", "orm", "pydantic", "async", "web-framework"]
|
@@ -0,0 +1 @@
|
|
1
|
+
__VERSION__ = "0.3.0"
|
@@ -34,6 +34,23 @@ class ModelMeta(type(TortoiseModel)):
|
|
34
34
|
# Grab the Schema class for further processing.
|
35
35
|
schema_opts = attrs.get("Schema", None)
|
36
36
|
|
37
|
+
# Create or get the inner Meta class
|
38
|
+
meta = attrs.get("Meta", type("Meta", (), {}))
|
39
|
+
|
40
|
+
# Infer app name from module if not explicitly set
|
41
|
+
if not hasattr(meta, "app"):
|
42
|
+
module = attrs.get("__module__", "")
|
43
|
+
module_parts = module.split(".")
|
44
|
+
if module_parts[-1] == "models":
|
45
|
+
inferred_app = module_parts[-2]
|
46
|
+
else:
|
47
|
+
inferred_app = module_parts[-1]
|
48
|
+
meta.app = inferred_app
|
49
|
+
|
50
|
+
# Prefix table name if not explicitly set
|
51
|
+
if not hasattr(meta, "table"):
|
52
|
+
meta.table = f"{meta.app}_{name.lower()}"
|
53
|
+
|
37
54
|
# Let Tortoise's Metaclass do it's thing.
|
38
55
|
new_cls = super().__new__(mcls, name, bases, attrs)
|
39
56
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__VERSION__ = "0.2.8"
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|