mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #2196 from guerler/extend_to_json_000
[16.04] Extend to_json for dataset tool parameters
This commit is contained in:
@@ -1673,13 +1673,16 @@ class BaseDataToolParameter( ToolParameter ):
|
||||
def to_json( self, value, app ):
|
||||
def single_to_json( value ):
|
||||
src = None
|
||||
if isinstance( value, galaxy.model.DatasetCollectionElement ):
|
||||
if isinstance( value, dict ) and 'src' in value and 'id' in value:
|
||||
return value
|
||||
elif isinstance( value, galaxy.model.DatasetCollectionElement ):
|
||||
src = 'dce'
|
||||
elif isinstance( value, app.model.HistoryDatasetCollectionAssociation ):
|
||||
src = 'hdca'
|
||||
else:
|
||||
elif hasattr( value, 'id' ):
|
||||
src = 'hda'
|
||||
return { 'id' : app.security.encode_id( value.id ), 'src' : src }
|
||||
if src is not None:
|
||||
return { 'id' : app.security.encode_id( value.id ), 'src' : src }
|
||||
|
||||
if value not in [ None, '', 'None' ]:
|
||||
if isinstance( value, list ) and len( value ) > 0:
|
||||
|
||||
Reference in New Issue
Block a user