'Cycle through meta files and return them as a list of dictionaries.'

def serialize_meta_files(self, dataset_assoc, key, **context):

    meta_files = []
    for meta_type in dataset_assoc.metadata.spec.keys():
        if isinstance(dataset_assoc.metadata.spec[meta_type].param, galaxy.datatypes.metadata.FileParameter):
            meta_files.append(dict(file_type=meta_type, download_url=self.url_for('history_contents_metadata_file', history_id=self.app.security.encode_id(dataset_assoc.history_id), history_content_id=self.app.security.encode_id(dataset_assoc.id), metadata_file=meta_type)))
    return meta_files
