[sqlalchemy] Generative query methods for aggregates.

2007-04-24 Thread Gaetan de Menten
Here is an experimental patch to add generative aggregate methods on query objects. My use case is that I have a class which is often queried with a sum query, from different places. But those different places usually add a filter on top of that basic query. And since I don't like repeating

[sqlalchemy] Re: Selectable/subquery for a (scalar) column?

2007-04-24 Thread Gaetan de Menten
On 4/24/07, Gaetan de Menten [EMAIL PROTECTED] wrote: On 4/23/07, Michael Bayer [EMAIL PROTECTED] wrote: On Apr 23, 2007, at 3:49 PM, Gaetan de Menten wrote: Hello there, In a mapped object, is there any way to map a scalar attribute to an arbitrary selectable/subquery?

[sqlalchemy] Re: different number range for primary key

2007-04-24 Thread Hong Yuan
On 4月24日, 下午5时09分, [EMAIL PROTECTED] wrote: orm-wise, u can probably use MapperExtension.before_insert(), and set up the value there. but this is worst as speed, synchronisation etc. Seems workable. I will try this. Although a solution on the SQL level would be better. At lower level (SQL)

[sqlalchemy] Re: pymssql and encoding - I can not get \x92 to be an '

2007-04-24 Thread [EMAIL PROTECTED]
I finally got the encoding to work. I moved from linux to windows, and now the encoding works with both pymssql and pyodbc. So it had to do with using FreeTDS. I experimented with FreeTDS.conf to use version 7.0 and 8.0 and various charsets, but could not get it to work, so I'll man up and use

[sqlalchemy] Re: Selectable/subquery for a (scalar) column?

2007-04-24 Thread Michael Bayer
On Apr 24, 2007, at 4:44 AM, Gaetan de Menten wrote: the next way is to do it almost the same as Jonathan's blog says to do it, except youd map the relation to some intermediary class like Score, and then use AssociationProxy to apply the scalar property to the class. I thought about

[sqlalchemy] Re: UpdateClause

2007-04-24 Thread Michael Bayer
On Apr 24, 2007, at 8:36 PM, Monty Taylor wrote: When I get into visit_update and look into the update_stmt.whereclause, I have a CompoundClause, which contains a single clause, and an AND condition, which is cool. But when I look at the clause, I have a column and a parameter. If I

[sqlalchemy] Re: Generated slow JOIN sql statement/specifying a left JOIN

2007-04-24 Thread Michael Bayer
On Apr 24, 2007, at 4:27 AM, Andreas Jung wrote: Because both tables are big the query takes forever. Using a LEFT JOIN would definitely be faster. Is there a way to configure the 'tools' property in a smarter way? not within the relation(), we dont support self-referential eager loads

[sqlalchemy] Re: UpdateClause

2007-04-24 Thread Monty Taylor
Michael Bayer wrote: On Apr 24, 2007, at 8:36 PM, Monty Taylor wrote: When I get into visit_update and look into the update_stmt.whereclause, I have a CompoundClause, which contains a single clause, and an AND condition, which is cool. But when I look at the clause, I have a column

[sqlalchemy] Re: Generated slow JOIN sql statement/specifying a left JOIN

2007-04-24 Thread Andreas Jung
--On 24. April 2007 08:54:55 -0400 Michael Bayer [EMAIL PROTECTED] wrote: On Apr 24, 2007, at 4:27 AM, Andreas Jung wrote: Because both tables are big the query takes forever. Using a LEFT JOIN would definitely be faster. Is there a way to configure the 'tools' property in a smarter