[sqlalchemy] dynamic query selection

2009-09-13 Thread Eric Lemoine
Hello list I have a simple mapping between a class and a table. What I'd like to be able to do is dynamically change the query selection (based on some HTTP param). More precisely I'd like that the ORM generate SELECT some_sql_function(col1), col2, col3 FROM ... instead of the default SELECT

[sqlalchemy] geoalchemy and reflected tables

2009-09-13 Thread Christoph Böhme
Hi all, I wonder if it is possible to reflect tables in a Postgres/PostGIS database with geoalchemy 0.1. The geoalchemy documentation only mentions delarative model definitions and my attempt to simply import * from geoalchemy and then reflect on the tables resulted in a warning when sqlalchemy

[sqlalchemy] Re: dynamic query selection

2009-09-13 Thread Michael Bayer
On Sep 13, 2009, at 5:32 AM, Eric Lemoine wrote: Hello list I have a simple mapping between a class and a table. What I'd like to be able to do is dynamically change the query selection (based on some HTTP param). More precisely I'd like that the ORM generate SELECT

[sqlalchemy] Re: geoalchemy and reflected tables

2009-09-13 Thread Michael Bayer
On Sep 13, 2009, at 7:01 AM, Christoph Böhme wrote: Hi all, I wonder if it is possible to reflect tables in a Postgres/PostGIS database with geoalchemy 0.1. The geoalchemy documentation only mentions delarative model definitions and my attempt to simply import * from geoalchemy and

[sqlalchemy] SQLAlchemy 0.5.6 released

2009-09-13 Thread Michael Bayer
This is a bugfix release, available for download at : http://www.sqlalchemy.org/download.html 0.5.6 = - orm - Fixed bug whereby inheritance discriminator part of a composite primary key would fail on updates. Continuation of [ticket:1300]. - Fixed bug which

[sqlalchemy] Re: dynamic query selection

2009-09-13 Thread Eric Lemoine
On Sunday, September 13, 2009, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 13, 2009, at 5:32 AM, Eric Lemoine wrote: Hello list I have a simple mapping between a class and a table. What I'd like to be able to do is dynamically change the query selection (based on some HTTP

[sqlalchemy] Re: How to count related objects from a many to many relations using subquery

2009-09-13 Thread Mario César
On Sep 11, 5:03 pm, Conor conor.edward.da...@gmail.com wrote: I believe what you want is: q = session.query(Option, func.count()) q = q.outerjoin((option_senators, option_senators.c.option_id == Option.id)) q = q.group_by(Option.id) q = q.order_by(Option.name) which will generate this

[sqlalchemy] Re: nullable=True doesn't work for TIMESTAMP under mysql

2009-09-13 Thread Michael Bayer
On Sep 13, 2009, at 7:27 PM, andrei wrote: I try to create the table with column: Column('ends_at', TIMESTAMP, nullable=True, server_default=) That results to SQL: CREATE TABLE news ( ends_at TIMESTAMP DEFAULT '', ) But mysql TIMESTAMP columns are NOT

[sqlalchemy] Re: nullable=True doesn't work for TIMESTAMP under mysql

2009-09-13 Thread Andrei
Thank you for the clarification! On Mon, Sep 14, 2009 at 5:47 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Sep 13, 2009, at 7:27 PM, andrei wrote: I try to create the table with column: Column('ends_at', TIMESTAMP, nullable=True, server_default=) That results to SQL: