Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2265 (closed defect: wontfix)

Opened 10 years ago

Last modified 10 years ago

Use `metadata.bind` rather than `db_session.configure` in `init_model`

Reported by: pitrou Owned by:
Priority: normal Milestone: 2.0rc1
Component: TurboGears Version: 2.0b7
Severity: minor Keywords:
Cc:

Description

In the autogenerated init_model() method (in model/__init__.py), replacing:

    db_session.configure(bind=engine)

with:

    metadata.bind = engine

allows to write init_model(migrate_engine) in sqlalchemy.migrate scripts.

Change History

comment:1 Changed 10 years ago by faide

binding the metadata is a bad idea. I'm sure we'll find another way to use the migrate scripts.

comment:2 Changed 10 years ago by pitrou

Why is it a bad idea?

comment:3 Changed 10 years ago by mramm

Well, it's not a bad idea generically, but this has been discussed on the mailing list lots of times.

Basically binding the metadata means you can't use different databases on different connections, etc and otherwise reduces the flexiblity of the system.

comment:4 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.