mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
flake8 fixes
This commit is contained in:
parent
0d62cf12a2
commit
4ddb571ded
@ -5,7 +5,7 @@ from the_app.database import get_db
|
|||||||
from the_app.models.nonsense import Nonsense
|
from the_app.models.nonsense import Nonsense
|
||||||
from the_app.schemas.nnonsense import NonsenseResponse, NonsenseSchema
|
from the_app.schemas.nnonsense import NonsenseResponse, NonsenseSchema
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter(prefix="/v1/nonsense")
|
||||||
|
|
||||||
|
|
||||||
@router.post("/", status_code=status.HTTP_201_CREATED, response_model=NonsenseResponse)
|
@router.post("/", status_code=status.HTTP_201_CREATED, response_model=NonsenseResponse)
|
||||||
|
@ -5,7 +5,7 @@ from the_app.database import get_db
|
|||||||
from the_app.models.stuff import Stuff
|
from the_app.models.stuff import Stuff
|
||||||
from the_app.schemas.stuff import StuffResponse, StuffSchema
|
from the_app.schemas.stuff import StuffResponse, StuffSchema
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter(prefix="/v1/stuff")
|
||||||
|
|
||||||
|
|
||||||
@router.post("/", status_code=status.HTTP_201_CREATED, response_model=StuffResponse)
|
@router.post("/", status_code=status.HTTP_201_CREATED, response_model=StuffResponse)
|
||||||
|
@ -9,10 +9,10 @@ from the_app.models.base import Base
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
app = FastAPI(title="Stuff And Nonsense", version="0.1")
|
app = FastAPI(title="Stuff And Nonsense", version="0.2")
|
||||||
|
|
||||||
app.include_router(stuff_router, prefix="/v1")
|
app.include_router(stuff_router)
|
||||||
app.include_router(nonsense_router, prefix="/v1")
|
app.include_router(nonsense_router)
|
||||||
|
|
||||||
|
|
||||||
async def start_db():
|
async def start_db():
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
from the_app.models.nonsense import Nonsense
|
from the_app.models.nonsense import Nonsense # noqa
|
||||||
from the_app.models.stuff import Stuff
|
from the_app.models.stuff import Stuff # noqa
|
||||||
|
@ -11,6 +11,7 @@ class Base:
|
|||||||
id: Any
|
id: Any
|
||||||
__name__: str
|
__name__: str
|
||||||
# Generate __tablename__ automatically
|
# Generate __tablename__ automatically
|
||||||
|
|
||||||
@declared_attr
|
@declared_attr
|
||||||
def __tablename__(cls) -> str:
|
def __tablename__(cls) -> str:
|
||||||
return cls.__name__.lower()
|
return cls.__name__.lower()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user