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 #2386 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

AttributeError when mapping a subclass with database.session_mapper

Reported by: chrisz Owned by:
Priority: high Milestone: 1.1.x bugfix
Component: SQLAlchemy Version: 1.1
Severity: major Keywords: sqlalchemy session mapper


When using the new database.session_mapper mapping an old-style class or a class that has already an __init__ method, you will get an Attribute error. This is because database.create_session_mapper directly checks __init__ and __init__._session_mapper which are not available in this cases; getattr() should be used here (see also bug report  here).

Also, similar to SQLAlchemy, database.create_session_mapper should have a keyword option set_kwargs_on_init=True for suppressing this feature.

Change History

comment:1 Changed 10 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in #6804.

comment:2 Changed 10 years ago by Chris Arndt

That should be r6804.

Thanks for fixing my mistake and especially for adding tests so it stays fixed!

Note: See TracTickets for help on using tickets.