'Turns a value read from a metadata into its value to be pushed directly into the external dict.'

def to_external_value(self, value):

    if isinstance(value, galaxy.model.MetadataFile):
        value = value.id
    elif isinstance(value, MetadataTempFile):
        value = MetadataTempFile.to_JSON(value)
    return value
