Added base model

This commit is contained in:
2024-04-01 18:37:33 +02:00
parent 30ad5e28c5
commit 9d6bdd60c8
3 changed files with 29 additions and 2 deletions

View File

@@ -5,7 +5,9 @@ from fastapi import HTTPException
from pydantic import BaseModel
from sqlalchemy.orm import Session
T = TypeVar("T") # TODO: bound=Base
from .models.base import Base
T = TypeVar("T", bound=Base)
def get_object_or_404(db_class: Type[T], id: UUID | str, db: Session, expunge: bool = False) -> T: