Ticket #1483 (closed defect: fixed)

Opened 9 months ago

Last modified 7 months ago

Make TG support SA 0.4

Reported by: paj Assigned to: paj
Priority: high Milestone: __unclassified__
Component: SQLAlchemy Version: 1.0.3
Severity: normal Keywords:
Cc:

Description

SA 0.4 has some backwards-incompatible changes. We need to make sure TG 1.0 at least basically works, and look harder at changing documentation and such for TG 1.1 and 2.

Attachments

TurboGears-1.0.3.2dev_r3487_database.py.diff (1.0 kB) - added by renier on 09/13/07 11:53:12.
Elixir-0.4.0___init__.py.diff (0.7 kB) - added by renier on 09/13/07 11:53:37.
Elixir-0.4.0_entity.py.diff (0.7 kB) - added by renier on 09/13/07 11:54:03.

Change History

08/18/07 10:59:48 changed by paj

Ok, good news is that there only seems to be one essential change - a reference to sqlalchemy.create_session that needs to become sqlalchemy.orm.create_session. I've made some changes to the unit tests as well, so they pass. Changes committed in [3407] for 1.0 branch and [3408] for 1.1.

I think there are more issues lurking around though, so I'm going to leave this ticket open.

08/18/07 11:02:18 changed by paj

  • component changed from TurboGears to SQLAlchemy.

08/27/07 06:27:15 changed by paj

We should probably add "from sqlalchemy.orm import *" to the top of the quickstart templates.

08/27/07 06:28:51 changed by paj

Need to fix the deprecation warnings as well, although a change I'm about to commit to SA will sort most of these.

08/27/07 06:49:30 changed by paj

Need to make sure that when sqlalchemy.echo=1, SQL is actually printed - seems not to be at the mo.

09/03/07 13:24:01 changed by paj

  • priority changed from normal to high.

Some changes may be necessary to visit and identity (e.g. user.get -> user.query.get)

We need different quickstarts for 0.3 and 0.4 (aaaggh!) as 0.3 uses assign_mapper, deprecated in 0.4.

Need to test carefully that Elixir works (and make unit tests) - some problems have been reported.

(follow-up: ↓ 8 ) 09/13/07 11:47:49 changed by renier

To get Elixir 0.4 and Turbogears-1.0.3.2, I had to make the following changes: Elixir's init.py - Make it use scoped_session instead of SessionContext? to avoid deprecation warnings in SQLAlchemy 0.4. Elixir's entity.py - Define a get method for the Entity class to avoid errors in TG's identity management. TG's database.py - Make it use elixir instead of the obsolete active mapper, plus a change to use session.context.registry, instead of session.context.current, since the change of using scoped_session.

I'm discussing the Elixir changes in this thread: http://groups.google.com/group/sqlelixir/browse_thread/thread/d97bc371b7d16f95

I'm attaching all patch files for reference, though I know the TG patch is the only one relevant in this place. However, its relevance depends on the Elixir patches.

(in reply to: ↑ 7 ) 09/13/07 11:51:21 changed by renier

--Reposting comment 7, now that I know you can wiki format--

To get Elixir 0.4 and Turbogears-1.0.3.2, I had to make the following changes:

  • Elixir's init.py - Make it use scoped_session instead of SessionContext?? to avoid deprecation warnings in SQLAlchemy 0.4.
  • Elixir's entity.py - Define a get method for the Entity class to avoid errors in TG's identity management.
  • TG's database.py - Make it use elixir instead of the obsolete active mapper, plus a change to use session.context.registry, instead of session.context.current, since the change of using scoped_session.

I'm discussing the Elixir changes in this thread: http://groups.google.com/group/sqlelixir/browse_thread/thread/d97bc371b7d16f95

I'm attaching all patch files for reference, though I know the TG patch is the only one relevant in this place. However, its relevance depends on the Elixir patches.

09/13/07 11:53:12 changed by renier

  • attachment TurboGears-1.0.3.2dev_r3487_database.py.diff added.

09/13/07 11:53:37 changed by renier

  • attachment Elixir-0.4.0___init__.py.diff added.

09/13/07 11:54:03 changed by renier

  • attachment Elixir-0.4.0_entity.py.diff added.

09/13/07 13:18:23 changed by renier

Tickets have been created for the elixir patches at:

09/21/07 14:25:34 changed by renier

http://elixir.ematia.de/trac/ticket/8 has been fixed and closed in Elixir trunk

10/13/07 15:29:05 changed by paj

Ok, some progress: I've made a change to activemapper and turbogears to fix most of the deprecation warnings. TG is now actually using scoped_session, so it needed some other changes.

On quickstart and visit/identity - it turns out no changes are necessary, although this hasn't been heavily tested. These modules use plain SA, not even assign_mapper, so they don't see those changes.

This leaves us to sort out logging, Elixir and documentation. I'll look at this as I have time.

10/13/07 16:03:30 changed by paj

Need to merge these changes into the 1.1 branch as well

10/13/07 16:11:28 changed by paj

Some quick tests show Elixir working fine with trunk Elixir and trunk TG, and both SA 0.3.10 and 0.4. Thanks for sorting this renier!

I've started some new documentation http://docs.turbogears.org/1.0/RoughDocs/SQLAlchemy

The logging problems are apparently due to "echo" being removed, an alternate configuration is used.

10/14/07 15:11:23 changed by paj

Ok, docs are pretty much done, including logging. And I've made a change to the dev.cfg template for this.

Once I've merged the changes into 1.1 (which is a fair task), this ticket will be ready to close off.

10/14/07 15:53:09 changed by paj

Changes are now merged into the 1.1 branch, that should be it!

I'll leave this ticket open for a week or so in case of problems.

10/24/07 13:56:18 changed by paj

  • status changed from new to closed.
  • resolution set to fixed.

Ok, no-one has complained yet! I notice Roger checked in some paginate fixes as well.