From cb5bfdebe1b9649962ce37a83a16ad3086ca5c63 Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Sat, 27 Sep 2025 05:33:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20hints=20for=20model-to-sch?= =?UTF-8?q?ema=20conversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cd67efd..3663877 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ > OhMyAPI == Application scaffolding for FastAPI+TortoiseORM. -OhMyAPI is a blazingly fast, async Python web application framework with batteries included. -It is built around FastAPI and TortoiseORM and is thus 100% async. +OhMyAPI is a Django-flavored web-application scaffolding framework. +It is blazingly fast, async and has batteries included. +Built around FastAPI and TortoiseORM makes it 100% async. Features: @@ -23,7 +24,7 @@ Features: **Creating a Project** ``` -pip install ohmyapi # TODO: not yet published +pip install ohmyapi ohmyapi startproject myproject cd myproject ``` @@ -93,13 +94,13 @@ router = APIRouter(prefix="/myapp") @router.get("/") async def list(): - return await Person.all() + return await Person.Schema.many.from_queryset(Person.all()) @router.get("/:id") async def get(id: int): try: - await Person.get(pk=id) + return await Person.Schema.one(Person.get(pk=id)) except DoesNotExist: raise HTTPException(status_code=404, detail="item not found")