orm filter -> where (#22801)

Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Asuka Minato
2025-07-24 01:57:45 +09:00
committed by GitHub
parent e64e7563f6
commit ef51678c73
161 changed files with 828 additions and 857 deletions

View File

@@ -138,7 +138,7 @@ class WorkflowDraftVariableService:
)
def get_variable(self, variable_id: str) -> WorkflowDraftVariable | None:
return self._session.query(WorkflowDraftVariable).filter(WorkflowDraftVariable.id == variable_id).first()
return self._session.query(WorkflowDraftVariable).where(WorkflowDraftVariable.id == variable_id).first()
def get_draft_variables_by_selectors(
self,
@@ -166,7 +166,7 @@ class WorkflowDraftVariableService:
def list_variables_without_values(self, app_id: str, page: int, limit: int) -> WorkflowDraftVariableList:
criteria = WorkflowDraftVariable.app_id == app_id
total = None
query = self._session.query(WorkflowDraftVariable).filter(criteria)
query = self._session.query(WorkflowDraftVariable).where(criteria)
if page == 1:
total = query.count()
variables = (
@@ -185,7 +185,7 @@ class WorkflowDraftVariableService:
WorkflowDraftVariable.app_id == app_id,
WorkflowDraftVariable.node_id == node_id,
)
query = self._session.query(WorkflowDraftVariable).filter(*criteria)
query = self._session.query(WorkflowDraftVariable).where(*criteria)
variables = query.order_by(WorkflowDraftVariable.created_at.desc()).all()
return WorkflowDraftVariableList(variables=variables)
@@ -328,7 +328,7 @@ class WorkflowDraftVariableService:
def delete_workflow_variables(self, app_id: str):
(
self._session.query(WorkflowDraftVariable)
.filter(WorkflowDraftVariable.app_id == app_id)
.where(WorkflowDraftVariable.app_id == app_id)
.delete(synchronize_session=False)
)
@@ -379,7 +379,7 @@ class WorkflowDraftVariableService:
if conv_id is not None:
conversation = (
self._session.query(Conversation)
.filter(
.where(
Conversation.id == conv_id,
Conversation.app_id == workflow.app_id,
)