[sqlalchemy] Removing aggregate function from query results

2008-11-10 Thread Ian Charnas
DATA nyc = City(name=New York City) michael_bayer = Bowler(name=Michael Bayer, highscore=299, city=nyc) big_lebowski = Bowler(name=Jeffrey Lebowsky, highscore=170, city=nyc) cle = City(name=Cleveland) ian_charnas = Bowler(name=Ian Charnas, highscore=220, city=cle) the_jesus = Bowler(name=Antonio

[sqlalchemy] Re: Removing aggregate function from query results

2008-11-10 Thread Ian Charnas
Bayer [EMAIL PROTECTED] wrote: On Nov 10, 2008, at 5:35 AM, Ian Charnas wrote: Hello Alchemy Land! If I have a simple test-case with Bowler objects and City objects, and I want to use func.max and group_by in order to find the highest scorers in each city... I might do something like

[sqlalchemy] Re: sqlite func,datetime

2007-07-06 Thread Ian Charnas
') and then use default=now in your table definition. -Ian Charnas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group

[sqlalchemy] [TICKET 614] [PATCH] - one-liner to fix orig_set on scalar selects

2007-06-20 Thread Ian Charnas
http://www.sqlalchemy.org/trac/ticket/614 basically this line: self.orig_set = [] needs to be this line: self.orig_set = util.Set() or certain selects will throw an error saying list type has no attribute 'add' I couldn't find a sqlalchemy-tickets list, so I thought I'd post here. -Ian

[sqlalchemy] Trying to detect which class methods were added by the mapper.

2007-06-12 Thread Ian Charnas
? I was hoping there would be something like Animal.select.mapper or Animal.select._sqlalchemy that I could use to differentiate which methods were added by the mapper and which were there originally, but I can't seem to find any such thing. many thanks in advance, -Ian Charnas from the Pagoda CMS

[sqlalchemy] Re: Executing SQL directly inside a thread local transaction?

2007-04-30 Thread Ian Charnas
query, you can do this: from sqlalchemy import * engine = create_engine(sqlite:///test.db) engine.execute(insert into people(first_name, last_name) values('ian', 'charnas')) engine.execute(select * from people).fetchall() [(1, 'ian', 'charnas')] note that metadata keeps track of tables, and session