commit/galaxy-central: greg: Filter out unwanted tool shed repositores from the list of valid repositories in the tool shed.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/6face40d6883/ changeset: 6face40d6883 user: greg date: 2012-07-03 22:06:11 summary: Filter out unwanted tool shed repositores from the list of valid repositories in the tool shed. affected #: 1 file diff -r ab1e5f08593151b35979b7371d001b50d0d3b39f -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -245,6 +245,19 @@ filterable="standard" ) ) operations = [] def build_initial_query( self, trans, **kwd ): + # The clause_list approach is to filter out those repositories that include metadata, but only because they contain 'invalid_tools' in + # the metadata (i.e., they don't have valid tools, datatypes or workflows). Is there a better approach? + clause_list = [] + for repository_metadata in trans.sa_session.query( trans.model.RepositoryMetadata ) \ + .filter( trans.model.RepositoryMetadata.table.c.malicious == False ): + metadata = repository_metadata.metadata + if 'datatypes' in metadata or'tools' in metadata or 'workflows' in metadata: + clause_list.append( trans.model.RepositoryMetadata.table.c.id == repository_metadata.id ) + if clause_list: + return trans.sa_session.query( self.model_class ) \ + .join( model.RepositoryMetadata.table ) \ + .join( model.User.table ) \ + .filter( or_( *clause_list ) ) return trans.sa_session.query( self.model_class ) \ .join( model.RepositoryMetadata.table ) \ .join( model.User.table ) 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)
-
Bitbucket