On May 13, 2007, at 1:42 PM, Michael Harrison wrote:
> > I'm trying to execute a simple query using SA. The following python > script *works*: > > dbsession = create_session() > results = dbsession.query(User).select_by(email='[EMAIL PROTECTED]') > for user in results: > print user.email > dbsession.close() > > However, I get an error when the following code executes from within a > mod_python function: > > dbsession = create_session() > results = dbsession.query(User).select_by(email='[EMAIL PROTECTED]') # > This throws an exception > > The error message I get is the following: > AttributeError: 'ColumnProperty' object has no attribute 'strategy' > something to do with either mappers not being compiled or with not all of your mapped classes completely set up. query(User) should compile all mappers immediately if they are not already so. cant tell much else without a full stack trace. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---