enh: automation
This commit is contained in:
1 parent
ee9db91df0
commit
406251c2f3
6 files changed
+85
No files matched your search
@@ -143,6 +143,10 @@ class AutomationTable:
|
||||
db.refresh(row)
|
||||
return AutomationModel.model_validate(row)
|
||||
|
||||
def count_by_user(self, user_id: str, db: Optional[Session] = None) -> int:
|
||||
with get_db_context(db) as db:
|
||||
return db.query(Automation).filter_by(user_id=user_id).count()
|
||||
|
||||
def get_by_id(self, id: str, db: Optional[Session] = None) -> Optional[AutomationModel]:
|
||||
with get_db_context(db) as db:
|
||||
row = db.get(Automation, id)
|
||||
|
||||
Reference in new issue
Block a user