2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2cfd745996f2/ changeset: 2cfd745996f2 user: jgoecks date: 2013-01-29 22:40:04 summary: Fixes for packing metadata in HDA api values. affected #: 1 file diff -r 0c42ee613365a48220925982a67ee37e82bf66ff -r 2cfd745996f221d3819e31ac3ca2eb06c900738b lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1529,8 +1529,9 @@ val = hda.metadata.get( name ) if isinstance( val, MetadataFile ): val = val.file_name - elif isinstance( val, list ): - val = ', '.join( [str(v) for v in val] ) + # If no value for metadata, look in datatype for metadata. + elif val == None and hasattr( hda.datatype, name ): + val = getattr( hda.datatype, name ) rval['metadata_' + name] = val return rval https://bitbucket.org/galaxy/galaxy-central/commits/01cbf01a2072/ changeset: 01cbf01a2072 user: jgoecks date: 2013-01-29 22:41:04 summary: Add metadata support to JavaScript dataset objects. affected #: 1 file diff -r 2cfd745996f221d3819e31ac3ca2eb06c900738b -r 01cbf01a20724514cda66a7071f1ecf376434157 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -1,6 +1,11 @@ define(["libs/backbone/backbone-relational"], function() { /** + * Dataset metedata. + */ +var DatasetMetadata = Backbone.RelationalModel.extend({}); + +/** * A dataset. In Galaxy, datasets are associated with a history, so * this object is also known as a HistoryDatasetAssociation. */ @@ -9,7 +14,33 @@ id: '', type: '', name: '', - hda_ldda: 'hda' + hda_ldda: 'hda', + metadata: null + }, + + initialize: function() { + // -- Create and initialize metadata. -- + + var metadata = new DatasetMetadata(); + + // Move metadata from dataset attributes to metadata object. + _.each(_.keys(this.attributes), function(k) { + if (k.indexOf('metadata_') === 0) { + // Found metadata. + var new_key = k.split('metadata_')[1]; + metadata.set(new_key, this.attributes[k]); + delete this.attributes[k]; + } + }, this); + + this.set('metadata', metadata); + }, + + /** + * Returns dataset metadata for a given attribute. + */ + get_metadata: function(attribute) { + return this.attributes.metadata.get(attribute); }, urlRoot: galaxy_paths.get('datasets_url') Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.