[sqlalchemy] Re: preserving uselist relation instances in a session.refresh()

2010-05-01 Thread Kent
Is it rude to ask why not disable the weakidentity map? Under the turbogears web framework, our Sessions only exist for the duration of the service call, and I am finding myself appending all these objects to a no_garbage_collect list that I am keeping on the session object anyway. Then the

Re: [sqlalchemy] Re: preserving uselist relation instances in a session.refresh()

2010-05-01 Thread Michael Bayer
On May 1, 2010, at 10:18 AM, Kent wrote: Is it rude to ask why not disable the weakidentity map? Under the turbogears web framework, our Sessions only exist for the duration of the service call, and I am finding myself appending all these objects to a no_garbage_collect list that I am

[sqlalchemy] Re: preserving uselist relation instances in a session.refresh()

2010-05-01 Thread Kent
If it is a feature you'd prefer to eventually get rid of, I will not use it. You are correct that not *everything* that is fetched do I need a strong ref to. You said: There's no problem with the strong map other than its a configuration switch that adds to potential confusion, and when in

Re: [sqlalchemy] Re: preserving uselist relation instances in a session.refresh()

2010-05-01 Thread Michael Bayer
On May 1, 2010, at 12:41 PM, Kent wrote: If it is a feature you'd prefer to eventually get rid of, I will not use it. You are correct that not *everything* that is fetched do I need a strong ref to. You said: There's no problem with the strong map other than its a configuration switch

Re: [sqlalchemy] upgrade to SQLA 0.6

2010-05-01 Thread Kent Bower
May help others: instead of col in const.columns I needed col in list(const.columns) to avoid: sqlalchemy.exc.ArgumentError: __contains__ requires a string argument with the ColumnCollection object On 4/30/2010 4:16 PM, Michael Bayer wrote: Kent wrote: I did read 0.6 Migration

Re: [sqlalchemy] upgrade to SQLA 0.6

2010-05-01 Thread Michael Bayer
On May 1, 2010, at 2:04 PM, Kent Bower wrote: May help others: instead of col in const.columns I needed col in list(const.columns) to avoid: sqlalchemy.exc.ArgumentError: __contains__ requires a string argument with the ColumnCollection object dont hate me but const.columns should

Re: [sqlalchemy] upgrade to SQLA 0.6

2010-05-01 Thread Kent Bower
Wait a second... ForeignKeyConstraint doesn't but PrimaryKeyConstraint does? (Not trying to be sassy, just wondering why I got the error in the first place) On 5/1/2010 2:11 PM, Michael Bayer wrote: On May 1, 2010, at 2:04 PM, Kent Bower wrote: May help others: instead of col in

Re: [sqlalchemy] upgrade to SQLA 0.6

2010-05-01 Thread Kent Bower
Oh, I get it, you are saying ColumnCollection has contains_column() method. On 5/1/2010 4:05 PM, Kent Bower wrote: Wait a second... ForeignKeyConstraint doesn't but PrimaryKeyConstraint does? (Not trying to be sassy, just wondering why I got the error in the first place) On 5/1/2010

Re: [sqlalchemy] upgrade to SQLA 0.6

2010-05-01 Thread Kent Bower
Yeah, this is a bit awkward. My code used to be able to say: = constraint_list = list(tab.constraints) for cnsts in constraint_list: if cnsts.contains_column(col): = And I can't replace that

Re: [sqlalchemy] upgrade to SQLA 0.6

2010-05-01 Thread Michael Bayer
contains_column() going away from ForeignKeyConstraint might have been in error (i.e. I dont recall intending to remove it). But at the same time the whole realm of contains a column is squirrely to me, since theres first two dimensions of, are you asking 'colname in collection' or 'column in

[sqlalchemy] Can anyone explain me why my thread block ???

2010-05-01 Thread christiandemo...@gmail.com
Hello everybody, i want to use SqlAlchemy in a thread but i have a problem. Here two files : *Orm.py* # -*- coding: ISO-8859-15 -*- from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.sql import func, exists from