commit/galaxy-central: carlfeberhard: HDA model: allow copying the purged attribute; History model: allow copying all datasets (including purged); History imp: change query param flag 'include_deleted' to 'all_datasets', send to History model copy; history/view: incorporate 'all_datasets' flag in import button
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3a5251e28801/ Changeset: 3a5251e28801 User: carlfeberhard Date: 2014-02-18 16:44:43 Summary: HDA model: allow copying the purged attribute; History model: allow copying all datasets (including purged); History imp: change query param flag 'include_deleted' to 'all_datasets', send to History model copy; history/view: incorporate 'all_datasets' flag in import button Affected #: 3 files diff -r 48f57ba4faed584929ab3ef31aa59f663d84a411 -r 3a5251e288011f02eff318a4dd88d76af4edcfd3 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -822,7 +822,12 @@ self.datasets.append( dataset ) return dataset - def copy( self, name=None, target_user=None, activatable=False ): + def copy( self, name=None, target_user=None, activatable=False, all_datasets=False ): + """ + Return a copy of this history using the given `name` and `target_user`. + If `activatable`, copy only non-deleted datasets. If `all_datasets`, copy + non-deleted, deleted, and purged datasets. + """ # Create new history. if not name: name = self.name @@ -845,6 +850,8 @@ # Copy HDAs. if activatable: hdas = self.activatable_datasets + elif all_datasets: + hdas = self.datasets else: hdas = self.active_datasets for hda in hdas: @@ -1682,6 +1689,9 @@ deleted=self.deleted, parent_id=parent_id, copied_from_history_dataset_association=self ) + # update init non-keywords as well + hda.purged = self.purged + object_session( self ).add( hda ) object_session( self ).flush() hda.set_size() diff -r 48f57ba4faed584929ab3ef31aa59f663d84a411 -r 3a5251e288011f02eff318a4dd88d76af4edcfd3 lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -783,8 +783,8 @@ else: referer_message = "<a href='%s'>go to Galaxy's start page</a>" % url_for( '/' ) - # include activatable/deleted datasets when copying? - include_deleted = util.string_as_bool( kwd.get( 'include_deleted', False ) ) + # include all datasets when copying? + all_datasets = util.string_as_bool( kwd.get( 'all_datasets', False ) ) # Do import. if not id: @@ -799,7 +799,7 @@ #dan: I can import my own history. #if import_history.user_id == user.id: # return trans.show_error_message( "You cannot import your own history.<br>You can %s." % referer_message, use_panels=True ) - new_history = import_history.copy( target_user=user, activatable=include_deleted ) + new_history = import_history.copy( target_user=user, all_datasets=all_datasets ) new_history.name = "imported: " + new_history.name new_history.user_id = user.id galaxy_session = trans.get_galaxy_session() diff -r 48f57ba4faed584929ab3ef31aa59f663d84a411 -r 3a5251e288011f02eff318a4dd88d76af4edcfd3 templates/webapps/galaxy/history/view.mako --- a/templates/webapps/galaxy/history/view.mako +++ b/templates/webapps/galaxy/history/view.mako @@ -98,7 +98,7 @@ %> %if not history[ 'purged' ]: <a id="import" class="btn btn-default" style="display: none;" - href="${h.url_for( controller='history', action='imp', id=history['id'], include_deleted=show_deleted )}"> + href="${h.url_for( controller='history', action='imp', id=history['id'], all_datasets=show_deleted )}"> ${_('Import and start using history')} </a> %endif @@ -133,7 +133,7 @@ // a bit hacky var href = $importBtn.attr( 'href' ), includeDeleted = $( this ).modeButton()[0].getMode().mode === 'exclude'; - href = href.replace( /include_deleted=True|False/, ( includeDeleted )?( 'True' ):( 'False' ) ); + href = href.replace( /all_datasets=True|False/, ( includeDeleted )?( 'True' ):( 'False' ) ); $importBtn.attr( 'href', href ); $importBtn.text( includeDeleted ? _l( 'Import with deleted datasets and start using history' ) : _l( 'Import and start using history' ) ); 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.
participants (1)
-
commits-noreply@bitbucket.org