ohmyapi 0.1.1__tar.gz → 0.1.3__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.1.1 → ohmyapi-0.1.3}/PKG-INFO +14 -6
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/README.md +13 -5
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/pyproject.toml +1 -1
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/builtin/auth/models.py +1 -1
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/__init__.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/builtin/auth/__init__.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/builtin/auth/permissions.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/builtin/auth/routes.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/cli.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/__init__.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/runtime.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/scaffolding.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/templates/app/__init__.py.j2 +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/templates/app/models.py.j2 +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/templates/app/routes.py.j2 +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/templates/project/pyproject.toml.j2 +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/core/templates/project/settings.py.j2 +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/db/__init__.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/db/migration_manager.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/db/model/__init__.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/db/model/model.py +0 -0
- {ohmyapi-0.1.1 → ohmyapi-0.1.3}/src/ohmyapi/router.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ohmyapi
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: A Django-like but async web-framework based on FastAPI and TortoiseORM.
|
5
5
|
License-Expression: MIT
|
6
6
|
Keywords: fastapi,tortoise,orm,async,web-framework
|
@@ -28,8 +28,9 @@ Description-Content-Type: text/markdown
|
|
28
28
|
|
29
29
|
> OhMyAPI == Application scaffolding for FastAPI+TortoiseORM.
|
30
30
|
|
31
|
-
OhMyAPI is a
|
32
|
-
|
31
|
+
OhMyAPI is a Django-flavored web-application scaffolding framework.
|
32
|
+
Built around FastAPI and TortoiseORM, it 100% async.
|
33
|
+
It is blazingly fast and has batteries included.
|
33
34
|
|
34
35
|
Features:
|
35
36
|
|
@@ -49,7 +50,7 @@ Features:
|
|
49
50
|
**Creating a Project**
|
50
51
|
|
51
52
|
```
|
52
|
-
pip install ohmyapi
|
53
|
+
pip install ohmyapi
|
53
54
|
ohmyapi startproject myproject
|
54
55
|
cd myproject
|
55
56
|
```
|
@@ -119,13 +120,13 @@ router = APIRouter(prefix="/myapp")
|
|
119
120
|
|
120
121
|
@router.get("/")
|
121
122
|
async def list():
|
122
|
-
return await Person.all()
|
123
|
+
return await Person.Schema.many.from_queryset(Person.all())
|
123
124
|
|
124
125
|
|
125
126
|
@router.get("/:id")
|
126
127
|
async def get(id: int):
|
127
128
|
try:
|
128
|
-
await Person.get(pk=id)
|
129
|
+
return await Person.Schema.one(Person.get(pk=id))
|
129
130
|
except DoesNotExist:
|
130
131
|
raise HTTPException(status_code=404, detail="item not found")
|
131
132
|
|
@@ -194,3 +195,10 @@ INSTALLED_APPS = [
|
|
194
195
|
JWT_SECRET = "t0ps3cr3t"
|
195
196
|
```
|
196
197
|
|
198
|
+
Create a super-user:
|
199
|
+
|
200
|
+
```
|
201
|
+
ohmyapi createsuperuser
|
202
|
+
```
|
203
|
+
|
204
|
+
|
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
> OhMyAPI == Application scaffolding for FastAPI+TortoiseORM.
|
4
4
|
|
5
|
-
OhMyAPI is a
|
6
|
-
|
5
|
+
OhMyAPI is a Django-flavored web-application scaffolding framework.
|
6
|
+
Built around FastAPI and TortoiseORM, it 100% async.
|
7
|
+
It is blazingly fast and has batteries included.
|
7
8
|
|
8
9
|
Features:
|
9
10
|
|
@@ -23,7 +24,7 @@ Features:
|
|
23
24
|
**Creating a Project**
|
24
25
|
|
25
26
|
```
|
26
|
-
pip install ohmyapi
|
27
|
+
pip install ohmyapi
|
27
28
|
ohmyapi startproject myproject
|
28
29
|
cd myproject
|
29
30
|
```
|
@@ -93,13 +94,13 @@ router = APIRouter(prefix="/myapp")
|
|
93
94
|
|
94
95
|
@router.get("/")
|
95
96
|
async def list():
|
96
|
-
return await Person.all()
|
97
|
+
return await Person.Schema.many.from_queryset(Person.all())
|
97
98
|
|
98
99
|
|
99
100
|
@router.get("/:id")
|
100
101
|
async def get(id: int):
|
101
102
|
try:
|
102
|
-
await Person.get(pk=id)
|
103
|
+
return await Person.Schema.one(Person.get(pk=id))
|
103
104
|
except DoesNotExist:
|
104
105
|
raise HTTPException(status_code=404, detail="item not found")
|
105
106
|
|
@@ -167,3 +168,10 @@ INSTALLED_APPS = [
|
|
167
168
|
|
168
169
|
JWT_SECRET = "t0ps3cr3t"
|
169
170
|
```
|
171
|
+
|
172
|
+
Create a super-user:
|
173
|
+
|
174
|
+
```
|
175
|
+
ohmyapi createsuperuser
|
176
|
+
```
|
177
|
+
|
@@ -13,7 +13,7 @@ class Group(Model):
|
|
13
13
|
|
14
14
|
class User(Model):
|
15
15
|
id = field.IntField(pk=True)
|
16
|
-
email = CharField(unique=True, index=True)
|
16
|
+
email = field.CharField(unique=True, index=True)
|
17
17
|
username = field.CharField(max_length=150, unique=True)
|
18
18
|
password_hash = field.CharField(max_length=128)
|
19
19
|
is_admin = field.BooleanField(default=False)
|
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
|