lib/galaxy/webapps/galaxy/services/history_contents.py
def _serialize_content_item(
            self,
            trans,
            content,
            dataset_details: Optional[DatasetDetailsType],
            serialization_params: SerializationParams,
            default_view: str = "summary",
    ):
        """
        Returns a dictionary with the appropriate values depending on the
        serialization parameters provided.
        """
        serialization_params_dict = serialization_params.dict()
        view = serialization_params_dict.pop("view", default_view) or default_view

        serializer: Optional[ModelSerializer] = None
        if isinstance(content, HistoryDatasetAssociation):
            serializer = self.hda_serializer
            if dataset_details and (dataset_details == 'all' or self.encode_id(content.id) in dataset_details):
                view = "detailed"
        elif isinstance(content, HistoryDatasetCollectionAssociation):
            serializer = self.hdca_serializer

        if serializer is None:
            raise exceptions.UnknownContentsType(f'Unknown contents type: {content.content_type}')

        return serializer.serialize_to_view(
            content, user=trans.user, trans=trans, view=view, **serialization_params_dict
        )

        Returns a dictionary with the appropriate values depending on the
        serialization parameters provided.
        
Returns a dictionary with the appropriate values depending on the
serialization parameters provided.
Returns a dictionary with the appropriate values depending on the serialization parameters provided .
def _serialize_content_item(
            self,
            trans,
            content,
            dataset_details: Optional[DatasetDetailsType],
            serialization_params: SerializationParams,
            default_view: str = "summary",
    ):
        serialization_params_dict = serialization_params.dict()
        view = serialization_params_dict.pop("view", default_view) or default_view
        serializer: Optional[ModelSerializer] = None
        if isinstance(content, HistoryDatasetAssociation):
            serializer = self.hda_serializer
            if dataset_details and (dataset_details == 'all' or self.encode_id(content.id) in dataset_details):
                view = "detailed"
        elif isinstance(content, HistoryDatasetCollectionAssociation):
            serializer = self.hdca_serializer
        if serializer is None:
            raise exceptions.UnknownContentsType(f'Unknown contents type: {content.content_type}')
        return serializer.serialize_to_view(
            content, user=trans.user, trans=trans, view=view, **serialization_params_dict
        )
def _serialize_content_item ( self , trans , content , dataset_details : Optional [ DatasetDetailsType ] , serialization_params : SerializationParams , default_view : str = "summary" , ) : serialization_params_dict = serialization_params . dict ( ) view = serialization_params_dict . pop ( "view" , default_view ) or default_view serializer : Optional [ ModelSerializer ] = None if isinstance ( content , HistoryDatasetAssociation ) : serializer = self . hda_serializer if dataset_details and ( dataset_details == 'all' or self . encode_id ( content . id ) in dataset_details ) : view = "detailed" elif isinstance ( content , HistoryDatasetCollectionAssociation ) : serializer = self . hdca_serializer if serializer is None : raise exceptions . UnknownContentsType ( f'Unknown contents type: {content.content_type}' ) return serializer . serialize_to_view ( content , user = trans . user , trans = trans , view = view , ** serialization_params_dict )
Returns a dictionary with the appropriate values depending on the
serialization parameters provided.
Returns a dictionary with the appropriate values depending on the serialization parameters provided .
"""
        Returns a dictionary with the appropriate values depending on the
        serialization parameters provided.
        """
self
trans
content
dataset_details
Optional[DatasetDetailsType]
serialization_params
SerializationParams
default_view
str