[sqlalchemy] Re: Two questions regarding unions.

2010-10-11 Thread Berteun
On Oct 9, 7:27 pm, Berteun bert...@gmail.com wrote: That's a bug and is addressed by ticket #1943 which includes a patch, and it would be extremely helpful if you could run this patch through your own tests before we commit it.  http://www.sqlalchemy.org/trac/ticket/1943 I can do that

[sqlalchemy] Newest records per category

2010-10-11 Thread Sebastian Elsner
Hello, I have one table called 'Assets' with a 'category' (String) and 'created' (DateTime) column. Now I would like to find the records created since a given datetime for each category: This is what I thought would work (with a self-join): session.query(Asset).join(Asset,

Re: [sqlalchemy] Newest records per category

2010-10-11 Thread Mark Erbaugh
On Oct 11, 2010, at 7:50 AM, Sebastian Elsner wrote: have one table called 'Assets' with a 'category' (String) and 'created' (DateTime) column. Now I would like to find the records created since a given datetime for each category: This is what I thought would work (with a self-join):

[sqlalchemy] Autoload=True and schema changes

2010-10-11 Thread Sven A. Schmidt
Hi, I've got an issue which pops up from time to time with an SQLAlchemy based webservice application and it revolves around schema changes happening while an engine with autoload=True has been instantiated and is being used to start sessions. What happens is that someone on the team will make a

Re: [sqlalchemy] Newest records per category

2010-10-11 Thread Sebastian Elsner
You are actually right. There was a logical mistake in my request, so I have to rephrase it: Having a table Assets with columns category (String) and created (DateTime), I would like to get the newest n records for each category. On 10/11/2010 04:30 PM, Mark Erbaugh wrote: On Oct 11, 2010,

Re: [sqlalchemy] Autoload=True and schema changes

2010-10-11 Thread Michael Bayer
On Oct 11, 2010, at 11:17 AM, Sven A. Schmidt wrote: Hi, I've got an issue which pops up from time to time with an SQLAlchemy based webservice application and it revolves around schema changes happening while an engine with autoload=True has been instantiated and is being used to start

[sqlalchemy] the c attribute on unions of similar tables

2010-10-11 Thread Carl
Everyone - TIA for any help. Here's my situation - I've got a large number of different tables that all have the same columns. I'd like to treat these tables as one giant table that I can query against. I thought I could do this by unioning all the tables, making a subquery and using the

Re: [sqlalchemy] the c attribute on unions of similar tables

2010-10-11 Thread Michael Bayer
On Oct 11, 2010, at 2:48 PM, Carl wrote: Everyone - TIA for any help. Here's my situation - I've got a large number of different tables that all have the same columns. I'd like to treat these tables as one giant table that I can query against. I thought I could do this by unioning all the

[sqlalchemy] Re: Autoload=True and schema changes

2010-10-11 Thread Sven A. Schmidt
Michael, thanks for your reply, which states what I expected is going on behind the scenes. However, for the case I mentioned (the env field that the mapper could not find anymore) I can say for certain that this particular table was not changed at all by DDL. This really puzzled me, obviously. I