[hg] galaxy 2949: imported patch alchemy05_fixes_01
details: http://www.bx.psu.edu/hg/galaxy/rev/133252175425 changeset: 2949:133252175425 user: Nate Coraor <nate@bx.psu.edu> date: Tue Nov 03 12:52:00 2009 -0500 description: imported patch alchemy05_fixes_01 diffstat: eggs.ini | 10 +- lib/galaxy/model/mapping.py | 2 +- lib/galaxy/model/migrate/check.py | 2 +- lib/galaxy/model/migrate/versions/0003_security_and_libraries.py | 4 +- lib/galaxy/model/migrate/versions/0004_indexes_and_defaults.py | 2 +- lib/galaxy/model/migrate/versions/0005_cleanup_datasets_fix.py | 4 +- lib/galaxy/model/migrate/versions/0006_change_qual_datatype.py | 2 +- lib/galaxy/model/migrate/versions/0008_galaxy_forms.py | 4 +- lib/galaxy/model/migrate/versions/0009_request_table.py | 2 +- lib/galaxy/model/migrate/versions/0010_hda_display_at_authz_table.py | 4 +- lib/galaxy/model/migrate/versions/0011_v0010_mysql_index_fix.py | 4 +- lib/galaxy/model/migrate/versions/0012_user_address.py | 4 +- lib/galaxy/model/migrate/versions/0013_change_lib_item_templates_to_forms.py | 2 +- lib/galaxy/model/migrate/versions/0017_library_item_indexes.py | 2 +- lib/galaxy/model/migrate/versions/0018_ordered_tags_and_page_tags.py | 2 +- lib/galaxy/model/migrate/versions/0019_request_library_folder.py | 4 +- lib/galaxy/model/migrate/versions/0020_library_upload_job.py | 4 +- lib/galaxy/model/orm/ext/assignmapper.py | 38 ++++++--- lib/galaxy/web/controllers/forms.py | 2 +- lib/galaxy/web/controllers/history.py | 2 +- lib/galaxy/web/controllers/page.py | 4 +- lib/galaxy/web/controllers/workflow.py | 22 ++-- lib/galaxy/web/framework/helpers/grids.py | 4 +- 23 files changed, 73 insertions(+), 57 deletions(-) diffs (502 lines): diff -r 80915982fdb2 -r 133252175425 eggs.ini --- a/eggs.ini Tue Nov 03 11:28:34 2009 -0500 +++ b/eggs.ini Tue Nov 03 12:52:00 2009 -0500 @@ -28,6 +28,7 @@ [eggs:noplatform] amqplib = 0.6.1 Beaker = 1.4 +decorator = 3.1.2 docutils = 0.4 elementtree = 1.2.6_20050316 lrucache = 0.2 @@ -41,8 +42,8 @@ PasteScript = 1.3.6 Routes = 1.6.3 simplejson = 1.5 -SQLAlchemy = 0.4.7p1 -sqlalchemy_migrate = 0.4.5 +SQLAlchemy = 0.5.6 +sqlalchemy_migrate = 0.5.4 Tempita = 0.1 twill = 0.9 WebError = 0.8a @@ -77,6 +78,7 @@ guppy = http://pypi.python.org/packages/source/g/guppy/guppy-0.1.8.tar.gz amqplib = http://py-amqplib.googlecode.com/files/amqplib-0.6.1.tgz Beaker = http://cheeseshop.python.org/packages/source/B/Beaker/Beaker-1.4.tar.gz +decorator = http://pypi.python.org/packages/source/d/decorator/decorator-3.1.2.tar.gz docutils = http://downloads.sourceforge.net/docutils/docutils-0.4.tar.gz elementtree = http://effbot.org/downloads/elementtree-1.2.6-20050316.tar.gz lrucache = http://evan.prodromou.name/lrucache/lrucache-0.2.tar.gz @@ -90,8 +92,8 @@ PSI = http://pypi.python.org/packages/source/P/PSI/PSI-0.3b1.1.tar.gz Routes = http://pypi.python.org/packages/source/R/Routes/Routes-1.6.3.tar.gz simplejson = http://cheeseshop.python.org/packages/source/s/simplejson/simplejson-1.5.tar... -SQLAlchemy = http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.4.7p1.tar.g... -sqlalchemy_migrate = http://pypi.python.org/packages/source/s/sqlalchemy-migrate/sqlalchemy-migra... +SQLAlchemy = http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.5.6.tar.gz +sqlalchemy_migrate = http://pypi.python.org/packages/source/s/sqlalchemy-migrate/sqlalchemy-migra... Tempita = http://pypi.python.org/packages/source/T/Tempita/Tempita-0.1.tar.gz twill = http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz WebError = http://pypi.python.org/packages/source/W/WebError/WebError-0.8a.tar.gz diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/mapping.py --- a/lib/galaxy/model/mapping.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/mapping.py Tue Nov 03 12:52:00 2009 -0500 @@ -18,7 +18,7 @@ from sqlalchemy.ext.associationproxy import association_proxy metadata = MetaData() -context = Session = scoped_session( sessionmaker( autoflush=False, transactional=False ) ) +context = Session = scoped_session( sessionmaker( autoflush=False, autocommit=True ) ) # For backward compatibility with "context.current" context.current = Session diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/check.py --- a/lib/galaxy/model/migrate/check.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/check.py Tue Nov 03 12:52:00 2009 -0500 @@ -7,7 +7,7 @@ from migrate.versioning import repository, schema from sqlalchemy import * -from sqlalchemy.exceptions import NoSuchTableError +from sqlalchemy.exc import NoSuchTableError log = logging.getLogger( __name__ ) diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0003_security_and_libraries.py --- a/lib/galaxy/model/migrate/versions/0003_security_and_libraries.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0003_security_and_libraries.py Tue Nov 03 12:52:00 2009 -0500 @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * @@ -20,7 +20,7 @@ from galaxy.model.custom_types import * metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) if migrate_engine.name == 'postgres': # http://blog.pythonisito.com/2008/01/cascading-drop-table-with-sqlalchemy.htm... diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0004_indexes_and_defaults.py --- a/lib/galaxy/model/migrate/versions/0004_indexes_and_defaults.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0004_indexes_and_defaults.py Tue Nov 03 12:52:00 2009 -0500 @@ -12,7 +12,7 @@ log.addHandler( handler ) metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) User_table = Table( "galaxy_user", metadata, autoload=True ) HistoryDatasetAssociation_table = Table( "history_dataset_association", metadata, autoload=True ) diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0005_cleanup_datasets_fix.py --- a/lib/galaxy/model/migrate/versions/0005_cleanup_datasets_fix.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0005_cleanup_datasets_fix.py Tue Nov 03 12:52:00 2009 -0500 @@ -23,7 +23,7 @@ metadata = MetaData( migrate_engine ) -context = scoped_session( sessionmaker( autoflush=False, transactional=False ) ) +context = scoped_session( sessionmaker( autoflush=False, autocommit=True ) ) ## classes @@ -662,7 +662,7 @@ log.debug( "Fixing a discrepancy concerning deleted shared history items." ) affected_items = 0 start_time = time.time() - for dataset in context.query( Dataset ).filter( and_( Dataset.c.deleted == True, Dataset.c.purged == False ) ): + for dataset in context.query( Dataset ).filter( and_( Dataset.deleted == True, Dataset.purged == False ) ): for dataset_instance in dataset.history_associations + dataset.library_associations: if not dataset_instance.deleted: dataset.deleted = False diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0006_change_qual_datatype.py --- a/lib/galaxy/model/migrate/versions/0006_change_qual_datatype.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0006_change_qual_datatype.py Tue Nov 03 12:52:00 2009 -0500 @@ -16,7 +16,7 @@ log.addHandler( handler ) metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "========================================" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0008_galaxy_forms.py --- a/lib/galaxy/model/migrate/versions/0008_galaxy_forms.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0008_galaxy_forms.py Tue Nov 03 12:52:00 2009 -0500 @@ -11,7 +11,7 @@ """ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * @@ -31,7 +31,7 @@ from galaxy.model.custom_types import * metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "========================================" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0009_request_table.py --- a/lib/galaxy/model/migrate/versions/0009_request_table.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0009_request_table.py Tue Nov 03 12:52:00 2009 -0500 @@ -9,7 +9,7 @@ from migrate.changeset import * import sys, logging from galaxy.model.custom_types import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * log = logging.getLogger( __name__ ) log.setLevel(logging.DEBUG) diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0010_hda_display_at_authz_table.py --- a/lib/galaxy/model/migrate/versions/0010_hda_display_at_authz_table.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0010_hda_display_at_authz_table.py Tue Nov 03 12:52:00 2009 -0500 @@ -10,7 +10,7 @@ """ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * @@ -30,7 +30,7 @@ from galaxy.model.custom_types import * metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "========================================" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0011_v0010_mysql_index_fix.py --- a/lib/galaxy/model/migrate/versions/0011_v0010_mysql_index_fix.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0011_v0010_mysql_index_fix.py Tue Nov 03 12:52:00 2009 -0500 @@ -5,7 +5,7 @@ """ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * @@ -25,7 +25,7 @@ from galaxy.model.custom_types import * metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "========================================" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0012_user_address.py --- a/lib/galaxy/model/migrate/versions/0012_user_address.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0012_user_address.py Tue Nov 03 12:52:00 2009 -0500 @@ -6,7 +6,7 @@ """ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * import datetime @@ -24,7 +24,7 @@ log.addHandler( handler ) metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "========================================" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0013_change_lib_item_templates_to_forms.py --- a/lib/galaxy/model/migrate/versions/0013_change_lib_item_templates_to_forms.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0013_change_lib_item_templates_to_forms.py Tue Nov 03 12:52:00 2009 -0500 @@ -17,7 +17,7 @@ """ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * import sys, logging diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0017_library_item_indexes.py --- a/lib/galaxy/model/migrate/versions/0017_library_item_indexes.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0017_library_item_indexes.py Tue Nov 03 12:52:00 2009 -0500 @@ -16,7 +16,7 @@ log.addHandler( handler ) metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) LibraryFolder_table = Table( "library_folder", metadata, autoload=True ) LibraryDatasetDatasetAssociation_table = Table( "library_dataset_dataset_association", metadata, autoload=True ) LibraryDataset_table = Table( "library_dataset", metadata, autoload=True ) diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0018_ordered_tags_and_page_tags.py --- a/lib/galaxy/model/migrate/versions/0018_ordered_tags_and_page_tags.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0018_ordered_tags_and_page_tags.py Tue Nov 03 12:52:00 2009 -0500 @@ -5,7 +5,7 @@ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * import migrate.changeset diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0019_request_library_folder.py --- a/lib/galaxy/model/migrate/versions/0019_request_library_folder.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0019_request_library_folder.py Tue Nov 03 12:52:00 2009 -0500 @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * import datetime @@ -18,7 +18,7 @@ log.addHandler( handler ) metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "========================================" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/migrate/versions/0020_library_upload_job.py --- a/lib/galaxy/model/migrate/versions/0020_library_upload_job.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/migrate/versions/0020_library_upload_job.py Tue Nov 03 12:52:00 2009 -0500 @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import * -from sqlalchemy.exceptions import * +from sqlalchemy.exc import * from migrate import * from migrate.changeset import * import datetime @@ -18,7 +18,7 @@ log.addHandler( handler ) metadata = MetaData( migrate_engine ) -db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, transactional=False ) ) +db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) def display_migration_details(): print "" diff -r 80915982fdb2 -r 133252175425 lib/galaxy/model/orm/ext/assignmapper.py --- a/lib/galaxy/model/orm/ext/assignmapper.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/model/orm/ext/assignmapper.py Tue Nov 03 12:52:00 2009 -0500 @@ -15,22 +15,36 @@ from sqlalchemy import util, exceptions import types -from sqlalchemy.orm import mapper, Query +from sqlalchemy.orm import Query +from sqlalchemy.orm import mapper as sqla_mapper -def _monkeypatch_session_method(name, session, class_, make_list=False): - def do(self, *args, **kwargs): - if make_list: - self = [ self ] - return getattr(session, name)( self, *args, **kwargs ) +def _monkeypatch_session_method( name, session, class_ ): + # TODO: eliminate this method by fixing the session flushes + def do( self, *args, **kwargs ): + if self not in session.deleted: + session.add( self ) + return session.flush() try: do.__name__ = name except: pass - if not hasattr(class_, name): - setattr(class_, name, do) - + if not hasattr( class_, name ): + setattr( class_, name, do ) +def session_mapper( scoped_session, class_, *args, **kwargs ): + def mapper( cls, *arg, **kw ): + validate = kw.pop( 'validate', False ) + if cls.__init__ is object.__init__: + def __init__( self, **kwargs ): + for key, value in kwargs.items(): + if validate: + if not cls_mapper.has_property( key ): + raise TypeError( "Invalid __init__ argument: '%s'" % key ) + setattr( self, key, value ) + cls.__init__ = __init__ + cls.query = scoped_session.query_property() + _monkeypatch_session_method( 'flush', scoped_session, cls ) + return sqla_mapper( cls, *arg, **kw ) + return mapper( class_, *args, **kwargs ) def assign_mapper( session, class_, *args, **kwargs ): - m = class_.mapper = session.mapper( class_, *args, **kwargs ) - for name in ( 'flush', ): - _monkeypatch_session_method( name, session, class_, make_list=True ) + m = class_.mapper = session_mapper( session, class_, *args, **kwargs ) return m diff -r 80915982fdb2 -r 133252175425 lib/galaxy/web/controllers/forms.py --- a/lib/galaxy/web/controllers/forms.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/web/controllers/forms.py Tue Nov 03 12:52:00 2009 -0500 @@ -450,7 +450,7 @@ # create corresponding row in the form_definition_current table fd.form_definition_current = fdc fdc.latest_form = fd - trans.sa_session.save_or_update( fdc ) + trans.sa_session.add( fdc ) trans.sa_session.flush() msg = "The new form named '%s' has been created. " % (fd.name) return fd, msg diff -r 80915982fdb2 -r 133252175425 lib/galaxy/web/controllers/history.py --- a/lib/galaxy/web/controllers/history.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/web/controllers/history.py Tue Nov 03 12:52:00 2009 -0500 @@ -726,7 +726,7 @@ share.history = history share.user = send_to_user session = trans.sa_session - session.save_or_update( share ) + session.add( share ) session.flush() if history not in shared_histories: shared_histories.append( history ) diff -r 80915982fdb2 -r 133252175425 lib/galaxy/web/controllers/page.py --- a/lib/galaxy/web/controllers/page.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/web/controllers/page.py Tue Nov 03 12:52:00 2009 -0500 @@ -135,7 +135,7 @@ page_revision.content = "" # Persist session = trans.sa_session - session.save_or_update( page ) + session.add( page ) session.flush() # Display the management page ## trans.set_message( "Page '%s' created" % page.title ) @@ -240,4 +240,4 @@ raise web.httpexceptions.HTTPNotFound() return trans.fill_template( "page/display.mako", page=page ) - \ No newline at end of file + diff -r 80915982fdb2 -r 133252175425 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/web/controllers/workflow.py Tue Nov 03 12:52:00 2009 -0500 @@ -30,7 +30,7 @@ user = trans.get_user() workflows = trans.sa_session.query( model.StoredWorkflow ) \ .filter_by( user=user, deleted=False ) \ - .order_by( desc( model.StoredWorkflow.c.update_time ) ) \ + .order_by( desc( model.StoredWorkflow.table.c.update_time ) ) \ .all() shared_by_others = trans.sa_session \ .query( model.StoredWorkflowUserShareAssociation ) \ @@ -53,13 +53,13 @@ user = trans.get_user() workflows = trans.sa_session.query( model.StoredWorkflow ) \ .filter_by( user=user, deleted=False ) \ - .order_by( desc( model.StoredWorkflow.c.update_time ) ) \ + .order_by( desc( model.StoredWorkflow.table.c.update_time ) ) \ .all() shared_by_others = trans.sa_session \ .query( model.StoredWorkflowUserShareAssociation ) \ .filter_by( user=user ) \ - .filter( model.StoredWorkflow.c.deleted == False ) \ - .order_by( desc( model.StoredWorkflow.c.update_time ) ) \ + .filter( model.StoredWorkflow.deleted == False ) \ + .order_by( desc( model.StoredWorkflow.table.c.update_time ) ) \ .all() return trans.fill_template( "workflow/list_for_run.mako", workflows = workflows, @@ -91,7 +91,7 @@ share.stored_workflow = stored share.user = other session = trans.sa_session - session.save_or_update( share ) + session.add( share ) session.flush() trans.set_message( "Workflow '%s' shared with user '%s'" % ( stored.name, other.email ) ) return trans.response.send_redirect( url_for( controller='workflow', action='sharing', id=id ) ) @@ -142,7 +142,7 @@ share.stored_workflow = stored share.user = trans.user session = trans.sa_session - session.save_or_update( share ) + session.add( share ) session.flush() # Redirect to load galaxy frames. return trans.response.send_redirect( url_for( controller='workflow' ) ) @@ -180,7 +180,7 @@ new_stored.user = user # Persist session = trans.sa_session - session.save_or_update( new_stored ) + session.add( new_stored ) session.flush() # Display the management page trans.set_message( 'Clone created with name "%s"' % new_stored.name ) @@ -205,7 +205,7 @@ stored_workflow.latest_workflow = workflow # Persist session = trans.sa_session - session.save_or_update( stored_workflow ) + session.add( stored_workflow ) session.flush() # Display the management page trans.set_message( "Workflow '%s' created" % stored_workflow.name ) @@ -514,7 +514,7 @@ stored.name = workflow_name workflow.stored_workflow = stored stored.latest_workflow = workflow - trans.sa_session.save_or_update( stored ) + trans.sa_session.add( stored ) trans.sa_session.flush() # Index page with message return trans.show_message( "Workflow '%s' created from current history." % workflow_name ) @@ -656,12 +656,12 @@ ids_in_menu = set( [ x.stored_workflow_id for x in user.stored_workflow_menu_entries ] ) workflows = trans.sa_session.query( model.StoredWorkflow ) \ .filter_by( user=user, deleted=False ) \ - .order_by( desc( model.StoredWorkflow.c.update_time ) ) \ + .order_by( desc( model.StoredWorkflow.table.c.update_time ) ) \ .all() shared_by_others = trans.sa_session \ .query( model.StoredWorkflowUserShareAssociation ) \ .filter_by( user=user ) \ - .filter( model.StoredWorkflow.c.deleted == False ) \ + .filter( model.StoredWorkflow.deleted == False ) \ .all() return trans.fill_template( "workflow/configure_menu.mako", workflows=workflows, diff -r 80915982fdb2 -r 133252175425 lib/galaxy/web/framework/helpers/grids.py --- a/lib/galaxy/web/framework/helpers/grids.py Tue Nov 03 11:28:34 2009 -0500 +++ b/lib/galaxy/web/framework/helpers/grids.py Tue Nov 03 12:52:00 2009 -0500 @@ -111,10 +111,10 @@ if sort_key.startswith( "-" ): sort_key = sort_key[1:] sort_order = 'desc' - query = query.order_by( self.model_class.c.get( sort_key ).desc() ) + query = query.order_by( self.model_class.table.c.get( sort_key ).desc() ) else: sort_order = 'asc' - query = query.order_by( self.model_class.c.get( sort_key ).asc() ) + query = query.order_by( self.model_class.table.c.get( sort_key ).asc() ) extra_url_args['sort'] = encoded_sort_key # There might be a current row
participants (1)
-
Greg Von Kuster