[sqlalchemy] Re: no error when using wrong 'attribute' name on an object

2007-01-06 Thread remi jolin
Michael Bayer a écrit : well, theres nothing that says the attribute youre sending in is wrong. classes in python dont have any notion of predeclared attribute names. a mapped class can have any number of other attributes which dont correspond to database-mapped attributes. Yes, of course.

[sqlalchemy] DynamicMetaData + create/drop table = confusion

2007-01-06 Thread Kumar McMillan
hello. I'm trying to use DynamicMetaData so that two separate tests can each connect to a unique db, create some tables, insert some data, delete that data, then drop the tables. This seems to yield ... sqlalchemy.exceptions.ConcurrentModificationError: Updated rowcount 0 does not match number

[sqlalchemy] Re: DynamicMetaData + create/drop table = confusion

2007-01-06 Thread Michael Bayer
when i run this program, I get no errors. a few things to note: it makes no sense to do a session.flush() after youve dropped the table (similarly, it makes no sense to flush() before youve done anything but thats less of an issue). if there were any modified state within your session

[sqlalchemy] Re: How to order by a field in a different table?

2007-01-06 Thread Jonathan Ellis
A query that doesn't rely on broken GROUP BY might look like select([forum_topics, select([func.max(forum_posts.c.created)], forum_posts.c.topic_id==forum_topics.c.id, scalar=True).label('last_post')], order_by=[desc('last_post')]) On 12/28/06, Mart