from sqlalchemy.orm import Session from app.crud.base import CRUDBase from app.models.ml_models_path.early_start import EarlyStartDTRModelPath from app.schemas.model_path.early_start import ( EarlyStartDTRModelPathCreate, EarlyStartDTRModelPathUpdate, ) class CRUDModelPathEarlyStartDTR( CRUDBase[ EarlyStartDTRModelPath, EarlyStartDTRModelPathCreate, EarlyStartDTRModelPathUpdate, ] ): def get_path_by_device( self, db: Session, device_id: str ) -> EarlyStartDTRModelPath | None: return ( db.query(self.model) .filter(EarlyStartDTRModelPath.device_id == device_id) .first() ) model_path_early_start_dtr = CRUDModelPathEarlyStartDTR(EarlyStartDTRModelPath)