-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ae480d
commit 038c646
Showing
7 changed files
with
100 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from app.routers.perceptual_model.router import router as perceptual_model_router | ||
from app.routers.process_taxonomy.router import router as process_taxonomy_router | ||
from app.routers.statistics.router import router as statistics_router | ||
from app.routers.spatial_zone.router import router as spatial_zone_router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import List | ||
|
||
from fastapi import APIRouter, Depends | ||
from sqlmodel import select | ||
|
||
from app.db import get_session | ||
from app.models import SpatialZoneType | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get( | ||
"/", | ||
description="Get all spatial zone types", | ||
response_model=List[SpatialZoneType], | ||
) | ||
def get_spatial_zones_entries(*, session=Depends(get_session)): | ||
""" | ||
Get spatial zone types from the database. | ||
Parameters: | ||
- session: The async session to use for database operations. | ||
Returns: | ||
- A list of spatial zone types. | ||
""" | ||
spatial_zone_types = session.exec(select(SpatialZoneType)).all() | ||
return spatial_zone_types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters