[sqlalchemy] already has a primary mapper defined error occurs occasionally

2012-01-10 Thread Josh Ha-Nyung Chung
I'm running web service using sqlalchemy with apache + wsgi + pyramid framework. I've initialize metadata like the following: Base = declarative_base() Base.metadata.reflect(bind=my_engine) user_table = DP_Base.metadata.tables[user] mapper(User, user_table) and I'm using scoped session since

Re: [sqlalchemy] already has a primary mapper defined error occurs occasionally

2012-01-10 Thread Michael Bayer
On Jan 10, 2012, at 11:38 AM, Josh Ha-Nyung Chung wrote: I'm running web service using sqlalchemy with apache + wsgi + pyramid framework. I've initialize metadata like the following: Base = declarative_base() Base.metadata.reflect(bind=my_engine) user_table =

Re: [sqlalchemy] already has a primary mapper defined error occurs occasionally

2012-01-10 Thread Josh Ha-Nyung Chung
User class extends object, not Base. Actually User class is imported from another package, which is made by my coworker, and I need to separate my work from his. So I have no choice but using classical mapping since the User class is intended to be used with classical mapping. -- Josh

Re: [sqlalchemy] already has a primary mapper defined error occurs occasionally

2012-01-10 Thread Michael Bayer
On Jan 10, 2012, at 12:12 PM, Josh Ha-Nyung Chung wrote: User class extends object, not Base. Actually User class is imported from another package, which is made by my coworker, and I need to separate my work from his. So I have no choice but using classical mapping since the User class