Skip to content

Commit

Permalink
Join/load: replace strings with attrs (webapps...controllers.workflow)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Jan 20, 2023
1 parent 9a3ec69 commit 94dfbda
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/galaxy/webapps/galaxy/controllers/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ def build_initial_query(self, trans, **kwargs):
# of its steps to be eagerly loaded.
return (
trans.sa_session.query(self.model_class)
.join("user")
.join(self.model_class.user)
.options(
lazyload("latest_workflow"),
joinedload("user").load_only("username"),
joinedload("annotations"),
undefer("average_rating"),
lazyload(self.model_class.latest_workflow),
joinedload(self.model_class.user).load_only(model.User.username),
joinedload(self.model_class.annotations),
undefer(self.model_class.average_rating),
)
)

Expand Down Expand Up @@ -487,7 +487,7 @@ def editor(self, trans, id=None, workflow_id=None, version=None):
trans.sa_session.query(model.StoredWorkflow)
.filter_by(user=trans.user, deleted=False, hidden=False)
.order_by(desc(model.StoredWorkflow.table.c.update_time))
.options(joinedload("latest_workflow").joinedload("steps"))
.options(joinedload(model.StoredWorkflow.latest_workflow).joinedload(model.Workflow.steps))
.all()
)
if version is None:
Expand Down

0 comments on commit 94dfbda

Please sign in to comment.