I ran into two problems when converting my code to assign_mapper for
turbogears.

1.   assign_mapper does not return the mapper as mapper does

employee_mapper = assign_mapper(ctx, Employee, employees)
manager_mapper = assign_mapper(ctx, Manager, managers, inherits =
employee_mapper)

Needs to be changed to

assign_mapper(ctx, Employee, employees)
assign_mapper(ctx, Manager, managers, inherits = Employee.mapper)

I would suggest that assign_mapper return the defined mapper to match
the original.


2.  Do not use python super(XXX, self).__init__() in inherited mapped
classes.

  This leads to runtime errors in sqlalchemy (3.7.1 and 3.8).  It
appears
that oldinit () is called twice for the class leading to some strange
session issues.

While the examples in the sqlalchemy documentation do not use super, I
didn't
see it exressedly discouraged and thought it was pretty standard..


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to