[sqlalchemy] pickling SQLAlchemy exceptions

2012-01-10 Thread Faheem Mitha
Hi, See http://stackoverflow.com/questions/8785899/hang-in-python-script-using-sqlalchemy-and-multiprocessing particularly sbt's answer (http://stackoverflow.com/a/8795763/350713), and also the Python bug reports http://bugs.python.org/issue13751 and http://bugs.python.org/issue1692335.

[sqlalchemy] Sequence on non primary_key and import data

2012-01-10 Thread Martijn Moeling
Hi, I am running into something I am using MySQL but am moving to Postgress so I'm looking for something compatible with the two. I have to generate an unique number for each record created into a column separate from the Id, call it SerialNumber I have found the Sequence object. Say I make

Re: [sqlalchemy] Re: 0.7 event migration

2012-01-10 Thread Kent Bower
funny story, here's where it was added: http://www.sqlalchemy.org/trac/ticket/1910 which is essentially your ticket ! :) I just double checked and I had patched in rfde41d0e9f70 http://www.sqlalchemy.org/trac/changeset/fde41d0e9f70/. Is there another commit that went against 1910? For

[sqlalchemy] Re: 0.7 event migration

2012-01-10 Thread Kent
See http://www.sqlalchemy.org/trac/ticket/2372 -- 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.

Re: [sqlalchemy] pickling SQLAlchemy exceptions

2012-01-10 Thread Michael Bayer
On Jan 10, 2012, at 4:01 AM, Faheem Mitha wrote: Hi, See http://stackoverflow.com/questions/8785899/hang-in-python-script-using-sqlalchemy-and-multiprocessing particularly sbt's answer (http://stackoverflow.com/a/8795763/350713), and also the Python bug reports

[sqlalchemy] Re: 0.7 event migration

2012-01-10 Thread Kent
Mike, Old code: == def visit_bindparam(bindparam): if bindparam.key in bind_to_col: bindparam.value = lambda: mapper._get_state_attr_by_column( state, dict_,

[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] Re: 0.7 event migration

2012-01-10 Thread Michael Bayer
Code wasn't covered and is a regresssion, fixed in rd6e321dc120d. On Jan 10, 2012, at 10:58 AM, Kent wrote: Mike, Old code: == def visit_bindparam(bindparam): if bindparam.key in bind_to_col:

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] Re: 0.7 event migration

2012-01-10 Thread Kent Bower
Thank you very much! On 1/10/2012 11:47 AM, Michael Bayer wrote: Code wasn't covered and is a regresssion, fixed in rd6e321dc120d. On Jan 10, 2012, at 10:58 AM, Kent wrote: Mike, Old code: == def visit_bindparam(bindparam):

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

[sqlalchemy] Re: SQL Alchemy Closure Table Relationship Definition

2012-01-10 Thread jonstjohn
Thanks for persisting with me - your solution was almost perfect, and really pointing me in the right direction. Below is what eventually worked: areas = relationship('DbArea', backref = backref('routes', order_by = 'DbRoute.name'), secondary = area_relationship_table,

[sqlalchemy] More 0.7 migration pains

2012-01-10 Thread Kent
After 0.7.5 migration, I'm sometimes hitting an issue from within merge(). unitofwork.py def track_cascade_events(descriptor, prop): ... def set_(state, newvalue, oldvalue, initiator): # process save_update cascade rules for when an instance # is attached to another instance

Re: [sqlalchemy] More 0.7 migration pains

2012-01-10 Thread Michael Bayer
On Jan 10, 2012, at 5:45 PM, Kent wrote: After 0.7.5 migration, I'm sometimes hitting an issue from within merge(). unitofwork.py def track_cascade_events(descriptor, prop): ... def set_(state, newvalue, oldvalue, initiator): # process save_update cascade rules for when an