[sqlalchemy] Re: IDEA: Call-local vs thread-local context

2008-07-04 Thread Iwan
svilen, On Jul 3, 5:58 pm, [EMAIL PROTECTED] wrote: it is possible to dig the stack to find the context u need... no worries about that, but u have to know the name of it, as there might be two contexts living in same scope (e.g.: copy data from DB1 to DB2), and u could get the wrong one --

[sqlalchemy] Re: IDEA: Call-local vs thread-local context

2008-07-04 Thread Iwan
Michael On Jul 3, 3:58 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Jul 3, 2008, at 5:05 AM, Iwan wrote: I was wondering if it is not possible to do something that is local to the current call-stack, instead of the current thread. [SNIP] the currentframe usage is something I'd leave to

[sqlalchemy] Re: ResultProxy does not autoclose

2008-07-04 Thread Henk
I see now where the problem came from, my dbapi module (experimental asynchonous mysql driver) was not returning None on the last call to its Cursor::fetchone implementation, instead it raised a StopIteration exception which was subsequently ignored in sqlalchemy Compiler::_handle_dbapi_exception

[sqlalchemy] Re: Need help with the shard session and query get function

2008-07-04 Thread Michael Bayer
On Jul 4, 2008, at 10:16 AM, lilo wrote: My shard_chooser func,shard_chooser_post, bailing out on, lk_rec = querylk.get([instance.username]) with an error (username is the primary key for Post table): File /usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/

[sqlalchemy] Newbie question

2008-07-04 Thread jrpfinch
I have just started using Python and TurboGears with SQLAlchemy and I think its great so far. I am working with an already-created database and am wondering what the best way is to represent the relationships between the recurring_task and employee_status table: employee_statuses =

[sqlalchemy] Re: Newbie question

2008-07-04 Thread jrpfinch
On 4 Jul, 18:03, jrpfinch [EMAIL PROTECTED] wrote: I have just started using Python and TurboGears with SQLAlchemy and I think its great so far. I am working with an already-created database and am wondering what the best way is to represent the relationships between the recurring_task and

[sqlalchemy] Re: Newbie question

2008-07-04 Thread Christoph Zwerschke
jrpfinch schrieb: mapper(Recurring_task, recurring_tasks, properties = {raiser:relation(Employee_status, primaryjoin=(recurring_tasks.c.rt_raiser_id==Employee_status.c.emp_id)}) ^ SyntaxError: invalid syntax There is one missing closing bracket. You should use an editor that helps

[sqlalchemy] 2nd Level Cache and RowTuples

2008-07-04 Thread Justin Tulloss
Hello, I'm using SQLAlchemy .5 to produce result sets composed of columns from multiple tables and mapped entities. I'd like to cache these results, but since RowTuples cannot be pickled, I'm having a hard time figuring out how to go about doing this. Any suggestions? Thanks, Justin

[sqlalchemy] Re: Need help with the shard session and query get function

2008-07-04 Thread Jay Decker
its nonsensical to call upon the ShardedSession *within* the query_chooser def. The ShardedSession can't do a query without a return value from the chooser, so that it knows which engine to query. I forgot to mention my lookup table is also sharded(in other words, lookup table is split into