[hg] galaxy 2469: Change folder.active_datasets mapper to a prop...
details: http://www.bx.psu.edu/hg/galaxy/rev/073c9a0b2467 changeset: 2469:073c9a0b2467 user: Greg Von Kuster <greg@bx.psu.edu> date: Wed Jul 08 17:01:49 2009 -0400 description: Change folder.active_datasets mapper to a property, and correct the list of library_datasets it returns - fixes the 'bug' part of ticket # 102 reported by Ross Lazarus. 3 file(s) affected in this change: lib/galaxy/model/__init__.py lib/galaxy/model/mapping.py lib/galaxy/web/controllers/admin.py diffs (54 lines): diff -r 035c0dc31963 -r 073c9a0b2467 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py Wed Jul 08 15:25:57 2009 -0400 +++ b/lib/galaxy/model/__init__.py Wed Jul 08 17:01:49 2009 -0400 @@ -734,11 +734,17 @@ def active_components( self ): return list( self.active_folders ) + list( self.active_datasets ) @property + def active_datasets( self ): + # This needs to be a list + return [ ld for ld in self.datasets if not ld.library_dataset_dataset_association.deleted ] + @property def activatable_datasets( self ): - return [ ld for ld in self.datasets if not ld.library_dataset_dataset_association.dataset.deleted ] #this needs to be a list + # This needs to be a list + return [ ld for ld in self.datasets if not ld.library_dataset_dataset_association.dataset.deleted ] @property #make this a relation def activatable_folders( self ): - return [ folder for folder in self.folders if not folder.purged ] #this needs to be a list + # This needs to be a list + return [ folder for folder in self.folders if not folder.purged ] class LibraryDataset( object ): # This class acts as a proxy to the currently selected LDDA diff -r 035c0dc31963 -r 073c9a0b2467 lib/galaxy/model/mapping.py --- a/lib/galaxy/model/mapping.py Wed Jul 08 15:25:57 2009 -0400 +++ b/lib/galaxy/model/mapping.py Wed Jul 08 17:01:49 2009 -0400 @@ -706,11 +706,6 @@ primaryjoin=( ( LibraryDataset.table.c.folder_id == LibraryFolder.table.c.id ) ), order_by=asc( LibraryDataset.table.c.order_id ), lazy=False, - viewonly=True ), - active_datasets=relation( LibraryDataset, - primaryjoin=( ( LibraryDataset.table.c.folder_id == LibraryFolder.table.c.id ) & ( not_( LibraryDataset.table.c.deleted ) ) ), - order_by=asc( LibraryDataset.table.c.order_id ), - lazy=False, viewonly=True ) ) ) diff -r 035c0dc31963 -r 073c9a0b2467 lib/galaxy/web/controllers/admin.py --- a/lib/galaxy/web/controllers/admin.py Wed Jul 08 15:25:57 2009 -0400 +++ b/lib/galaxy/web/controllers/admin.py Wed Jul 08 17:01:49 2009 -0400 @@ -1937,10 +1937,11 @@ ldda = trans.app.model.LibraryDatasetDatasetAssociation.get( id ) ldda.deleted = True ldda.flush() - msg = "The selected datasets have been removed from this library" + msg = "The selected datasets have been removed from this library" trans.response.send_redirect( web.url_for( controller='admin', action='browse_library', id=library_id, + show_deleted=False, msg=util.sanitize_text( msg ), messagetype='done' ) ) else:
participants (1)
-
Greg Von Kuster