mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add service layer for history query endpoint
This commit is contained in:
@@ -51,6 +51,10 @@ from galaxy.schema import (
|
||||
SerializationParams,
|
||||
)
|
||||
from galaxy.schema.fields import DecodedDatabaseIdField
|
||||
from galaxy.schema.history import (
|
||||
HistoryIndexQueryPayload,
|
||||
HistorySummaryList,
|
||||
)
|
||||
from galaxy.schema.schema import (
|
||||
AnyArchivedHistoryView,
|
||||
AnyHistoryView,
|
||||
@@ -211,6 +215,23 @@ class HistoriesService(ServiceBase, ConsumesModelStores, ServesExportStores):
|
||||
# otherwise, do the default filter of removing the deleted histories
|
||||
return [model.History.deleted == false()]
|
||||
|
||||
def index_query(
|
||||
self,
|
||||
trans,
|
||||
payload: HistoryIndexQueryPayload,
|
||||
include_total_count: bool = False,
|
||||
) -> Tuple[HistorySummaryList, int]:
|
||||
"""Return a list of History accessible by the user
|
||||
|
||||
:rtype: list
|
||||
:returns: dictionaries containing History details
|
||||
"""
|
||||
entries, total_matches = self.manager.index_query(trans, payload, include_total_count)
|
||||
return (
|
||||
HistorySummaryList(__root__=[entry.to_dict() for entry in entries]),
|
||||
total_matches,
|
||||
)
|
||||
|
||||
def create(
|
||||
self,
|
||||
trans: ProvidesHistoryContext,
|
||||
|
||||
Reference in New Issue
Block a user