Skip to content

Commit 83d69fc

Browse files
authored
feat: add typing
1 parent 623b647 commit 83d69fc

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

backend/app/crud/overlay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
router = APIRouter()
1010

11-
async def get_overlays(session: AsyncSession = Depends(get_db)):
11+
async def get_overlays(session: AsyncSession = Depends(get_db)) -> list:
1212
result = await session.execute(select(Overlay))
1313
overlays = result.scalars().all()
1414
return [OverlayCreate(riotId=overlay.riotId, hdevApiKey=overlay.hdevApiKey, uuid=overlay.uuid) for overlay in overlays]

backend/app/schemas/overlay.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ class OverlaySchema(BaseModel):
1111
tag: str
1212

1313
class Config:
14-
orm_mode = True
14+
orm_mode: bool = True
1515

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

2019
class OverlayRead(OverlayBase):
2120
uuid: uuid_pkg.UUID
2221

2322
class Config:
24-
orm_mode = True
23+
orm_mode: bool = True

backend/app/settings.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
def str_to_bool(value: str) -> bool:
77
return value.lower() in ("true", "1", "yes")
88

9-
BASE_DIR = Path(__file__).resolve().parent.parent.parent
9+
BASE_DIR: str = Path(__file__).resolve().parent.parent.parent
1010

11-
dotenv_file = BASE_DIR / '.env'
11+
dotenv_file: str = BASE_DIR / '.env'
1212
if dotenv_file.is_file():
1313
load_dotenv(dotenv_file)
1414
else:
1515
raise ImportError('⚠ .env was not found')
1616

1717

18-
DEBUG = str_to_bool(environ.get("DEBUG", "False"))
18+
DEBUG: bool = str_to_bool(environ.get("DEBUG", "False"))
1919

20-
PROJECT_NAME = environ.get('PROJECT_NAME')
21-
VERSION = environ.get('VERSION')
20+
PROJECT_NAME: str = environ.get('PROJECT_NAME')
21+
VERSION: str = environ.get('VERSION')
2222

23-
DATABASE_URL = environ.get('DATABASE_URL')
24-
DEGUB_DATABASE_URL = environ.get('DEGUB_DATABASE_URL')
23+
DATABASE_URL: str = environ.get('DATABASE_URL')
24+
DEGUB_DATABASE_URL: str = environ.get('DEGUB_DATABASE_URL')

0 commit comments

Comments
 (0)