strattonbrazil wrote: > > What is the purpose of class_mapper? I can't find it in the .4 docs > for the tutorials I'm looking at, yet when I don't call it as > > https://svn.enthought.com/svn/enthought/sandbox/EnvisageSQLAlchemy/enthought/sqlalchemy/has_traits_orm.py > > notes, I get a > > AttributeError: > # 'ColumnProperty' object has no attribute 'key'
that is an ancient bug which refers to the fact that mappers have not been compiled, yet an expression is doing something along the lines of "User.some_property == <somevalue>". The "Class.descriptor" expression approach was new in 0.4 and had some incompleteness. To work around it in 0.4 the most general way is to call compile_mappers(). class_mapper() also has the effect of invoking a "compile" if the mapper being returned was not yet compiled. class_mapper() in modern SQLAlchemy would normally only be used if additional configuration needs to be added to an existing mapper, given only a class. --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---