Skip to content

Commit

Permalink
feat: add typing
Browse files Browse the repository at this point in the history
  • Loading branch information
haxgun authored Nov 28, 2024
1 parent 623b647 commit 83d69fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/app/crud/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

router = APIRouter()

async def get_overlays(session: AsyncSession = Depends(get_db)):
async def get_overlays(session: AsyncSession = Depends(get_db)) -> list:
result = await session.execute(select(Overlay))
overlays = result.scalars().all()
return [OverlayCreate(riotId=overlay.riotId, hdevApiKey=overlay.hdevApiKey, uuid=overlay.uuid) for overlay in overlays]
Expand Down
5 changes: 2 additions & 3 deletions backend/app/schemas/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ class OverlaySchema(BaseModel):
tag: str

class Config:
orm_mode = True
orm_mode: bool = True

# Схема для создания записи
class OverlayCreate(OverlayBase):
pass

class OverlayRead(OverlayBase):
uuid: uuid_pkg.UUID

class Config:
orm_mode = True
orm_mode: bool = True
14 changes: 7 additions & 7 deletions backend/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
def str_to_bool(value: str) -> bool:
return value.lower() in ("true", "1", "yes")

BASE_DIR = Path(__file__).resolve().parent.parent.parent
BASE_DIR: str = Path(__file__).resolve().parent.parent.parent

dotenv_file = BASE_DIR / '.env'
dotenv_file: str = BASE_DIR / '.env'
if dotenv_file.is_file():
load_dotenv(dotenv_file)
else:
raise ImportError('⚠ .env was not found')


DEBUG = str_to_bool(environ.get("DEBUG", "False"))
DEBUG: bool = str_to_bool(environ.get("DEBUG", "False"))

PROJECT_NAME = environ.get('PROJECT_NAME')
VERSION = environ.get('VERSION')
PROJECT_NAME: str = environ.get('PROJECT_NAME')
VERSION: str = environ.get('VERSION')

DATABASE_URL = environ.get('DATABASE_URL')
DEGUB_DATABASE_URL = environ.get('DEGUB_DATABASE_URL')
DATABASE_URL: str = environ.get('DATABASE_URL')
DEGUB_DATABASE_URL: str = environ.get('DEGUB_DATABASE_URL')

0 comments on commit 83d69fc

Please sign in to comment.