[sqlalchemy] Re: Unit testing with SA?

2007-02-03 Thread sdobrev
There is more; to have really independent tests u have to destroy all SA caches and mappers etc. metadata.drop_all() clear_mappers() db.dispose() and always let ALL sessions etc fall out of scope. Make sure u do not store exception contexts, nor any persistent objects between the tests.

[sqlalchemy] construct flexible query via sqlalchemy

2007-02-03 Thread dischdennis
Hi, I would like to build a query dynamically: I have a list called process_ids that contains the process ids that should be included in the result set. so the or_ tuple has to be filled according to the number of items in list here an example with 2 items: where =

[sqlalchemy] sqlalchemy lost connection?

2007-02-03 Thread dischdennis
Hi I am using sqlalchemy with zope and when I have the server running a while ( 6 hours) without interaction, I cannot access any site, (OperationalError) (2013, 'Lost connection to MySQL server during query'), and have to restart the server.

[sqlalchemy] Re: Assign mapper many-to-many with extra columns

2007-02-03 Thread iain duncan
On Fri, 2007-02-02 at 21:41 -0500, Karl Guertin wrote: Did my suggestion of dropping 'ordering' off of the article and adding an order_by clause to the relation not work? # article mapper assign_mapper( session.context, Article, article_table) # page mapper with m-to-m relation on

[sqlalchemy] Re: what is considered circular dep at session.flush() ?

2007-02-03 Thread sdobrev
yeah im no mathematician but i dont think you can use just part of a theory thats designed for flow diagrams with some totally different kind of diagram. well, relational algebra, or graph theory is just that, and can be used for wbatever one finds applicable. diff Application aspects may

[sqlalchemy] Re: Assign mapper many-to-many with extra columns

2007-02-03 Thread Karl Guertin
On 2/3/07, iain duncan [EMAIL PROTECTED] wrote: InvalidRequestError: Given column 'page_article.ordering', attached to table 'page_article', failed to locate a corresponding column from table 'article_36c9' I'd think that you're missing the .c. in the middle: page_article.c.ordering

[sqlalchemy] Re: what is considered circular dep at session.flush() ?

2007-02-03 Thread sdobrev
noting that, i have spent almost no time at all on supporting concrete patterns at this point (also, nobody has really complained). no worries, i've doing now a cut over proper graph, built in similar way as the one unitofwork's topology is using, scratch that, instead i propagated a

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-02-03 Thread Michael Bayer
On Jan 31, 1:28 pm, svilen [EMAIL PROTECTED] wrote: another things i noted: - using value.lower() == value instead of value.islower() ha x = 27 x.islower() False x.lower() == x True breaks a lot of tests too --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: sqlalchemy lost connection?

2007-02-03 Thread iain duncan
On Sat, 2007-03-02 at 20:53 -0500, Mike Bernson wrote: Mysql has a timeout idle connection. You might be running into this. I think it defaults to 8 hours It sounds like you are running into the idle timeout. dischdennis wrote: Hi I am using sqlalchemy with zope and when I have the

[sqlalchemy] Inspect and __init__ of a mapped class

2007-02-03 Thread Patrick Lewis
Hi, I'm trying to create a mapped object where I don't know what the exact constructor arguments of the object might be. I was trying to use the inspect module to get the right arguments, but it looks like the mapper is redefining the original class __init__. Any thoughts as to how I might

[sqlalchemy] Re: Assign mapper many-to-many with extra columns

2007-02-03 Thread iain duncan
On Sat, 2007-03-02 at 18:44 -0500, Karl Guertin wrote: On 2/3/07, iain duncan [EMAIL PROTECTED] wrote: InvalidRequestError: Given column 'page_article.ordering', attached to table 'page_article', failed to locate a corresponding column from table 'article_36c9' I'd think that you're

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-02-03 Thread sdobrev
- using value.lower() == value instead of value.islower() ha x = 27 x.islower() False x.lower() == x True breaks a lot of tests too okay, forget that. Here an example OrderedSet over set; that seems to give a bigger speedup than anything else, and without touching anything.