mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merging heads
This commit is contained in:
@@ -484,8 +484,12 @@ class SelectToolParameter( ToolParameter ):
|
||||
else:
|
||||
return self.static_options
|
||||
def get_legal_values( self, trans, other_values ):
|
||||
def _get_UnvalidatedValue_value( value ):
|
||||
if isinstance( value, UnvalidatedValue ):
|
||||
return value.value
|
||||
return value
|
||||
if self.options:
|
||||
return set( v for _, v, _ in self.options.get_options( trans, other_values ) )
|
||||
return map( _get_UnvalidatedValue_value, set( v for _, v, _ in self.options.get_options( trans, other_values ) ) )
|
||||
elif self.dynamic_options:
|
||||
return set( v for _, v, _ in eval( self.dynamic_options, self.tool.code_namespace, other_values ) )
|
||||
else:
|
||||
@@ -510,6 +514,9 @@ class SelectToolParameter( ToolParameter ):
|
||||
field = form_builder.SelectField( self.name, self.multiple, self.display, self.refresh_on_change )
|
||||
options = self.get_options( trans, other_values )
|
||||
for text, optval, selected in options:
|
||||
if isinstance( optval, UnvalidatedValue ):
|
||||
optval = optval.value
|
||||
text = "%s (unvalidated)" % text
|
||||
if value:
|
||||
selected = ( optval in value )
|
||||
field.add_option( text, optval, selected )
|
||||
|
||||
@@ -108,7 +108,8 @@ class DataMetaFilter( Filter ):
|
||||
if not isinstance( ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ):
|
||||
return [] #not a valid dataset
|
||||
meta_value = ref.metadata.get( self.key, None )
|
||||
assert meta_value is not None, "Required metadata value '%s' not found in referenced dataset" % self.key
|
||||
if meta_value is None: #assert meta_value is not None, "Required metadata value '%s' not found in referenced dataset" % self.key
|
||||
return [ ( disp_name, basic.UnvalidatedValue( optval ), selected ) for disp_name, optval, selected in options ]
|
||||
|
||||
if self.column is not None:
|
||||
rval = []
|
||||
|
||||
Reference in New Issue
Block a user