2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/1b279375e33d/ Changeset: 1b279375e33d Branch: next-stable User: Dave Bouvier Date: 2013-05-22 16:40:04 Summary: Fix for filtering by skip_tool_test in the repository revisions tool shed API controller. Affected #: 1 file diff -r 6f6ea9a765f6a0824fe0500e9b656f86143aa44c -r 1b279375e33d1139b60f8e13c4b1de8a0c27b438 lib/galaxy/webapps/tool_shed/api/repository_revisions.py --- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py +++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py @@ -4,7 +4,7 @@ from tool_shed.util import metadata_util from galaxy import web from galaxy import util -from galaxy.model.orm import and_ +from galaxy.model.orm import and_, not_, select from galaxy.web.base.controller import BaseAPIController log = logging.getLogger( __name__ ) @@ -62,21 +62,17 @@ skip_tool_test = kwd.get( 'skip_tool_test', None ) if skip_tool_test is not None: skip_tool_test = util.string_as_bool( skip_tool_test ) + skipped_metadata_ids_subquery = select( [ trans.app.model.SkipToolTest.table.c.repository_metadata_id ] ) + if skip_tool_test: + clause_list.append( trans.model.RepositoryMetadata.id.in_( skipped_metadata_ids_subquery ) ) + else: + clause_list.append( not_( trans.model.RepositoryMetadata.id.in_( skipped_metadata_ids_subquery ) ) ) # Generate and execute the query. try: - if skip_tool_test: - # The skip_tool_test filter was received as True. - query = trans.sa_session.query( trans.app.model.RepositoryMetadata ) \ - .join( trans.model.SkipToolTest ) \ - .filter( and_( *clause_list ) ) \ - .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ - .all() - else: - # The skip_tool_test filter was not received or it was received as False. - query = trans.sa_session.query( trans.app.model.RepositoryMetadata ) \ - .filter( and_( *clause_list ) ) \ - .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ - .all() + query = trans.sa_session.query( trans.app.model.RepositoryMetadata ) \ + .filter( and_( *clause_list ) ) \ + .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ + .all() for repository_metadata in query: repository_metadata_dict = repository_metadata.get_api_value( view='collection', value_mapper=default_value_mapper( trans, repository_metadata ) ) https://bitbucket.org/galaxy/galaxy-central/commits/2a630237801f/ Changeset: 2a630237801f User: Dave Bouvier Date: 2013-05-22 16:41:01 Summary: Merge in next-stable. Affected #: 1 file diff -r 9d2b0932e6b43f6e8c5fa7525e10d70b799fdf17 -r 2a630237801ffefdd63e47c5acdcc1abadba23ef lib/galaxy/webapps/tool_shed/api/repository_revisions.py --- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py +++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py @@ -4,7 +4,7 @@ from tool_shed.util import metadata_util from galaxy import web from galaxy import util -from galaxy.model.orm import and_ +from galaxy.model.orm import and_, not_, select from galaxy.web.base.controller import BaseAPIController log = logging.getLogger( __name__ ) @@ -62,21 +62,17 @@ skip_tool_test = kwd.get( 'skip_tool_test', None ) if skip_tool_test is not None: skip_tool_test = util.string_as_bool( skip_tool_test ) + skipped_metadata_ids_subquery = select( [ trans.app.model.SkipToolTest.table.c.repository_metadata_id ] ) + if skip_tool_test: + clause_list.append( trans.model.RepositoryMetadata.id.in_( skipped_metadata_ids_subquery ) ) + else: + clause_list.append( not_( trans.model.RepositoryMetadata.id.in_( skipped_metadata_ids_subquery ) ) ) # Generate and execute the query. try: - if skip_tool_test: - # The skip_tool_test filter was received as True. - query = trans.sa_session.query( trans.app.model.RepositoryMetadata ) \ - .join( trans.model.SkipToolTest ) \ - .filter( and_( *clause_list ) ) \ - .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ - .all() - else: - # The skip_tool_test filter was not received or it was received as False. - query = trans.sa_session.query( trans.app.model.RepositoryMetadata ) \ - .filter( and_( *clause_list ) ) \ - .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ - .all() + query = trans.sa_session.query( trans.app.model.RepositoryMetadata ) \ + .filter( and_( *clause_list ) ) \ + .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ + .all() for repository_metadata in query: repository_metadata_dict = repository_metadata.get_api_value( view='collection', value_mapper=default_value_mapper( trans, repository_metadata ) ) 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.