Re: [sqlalchemy] Re: SQLAlchemy NotImplementedError when doing a metadata create_all

2010-07-27 Thread Michael Bayer
On Jul 27, 2010, at 1:34 AM, Faheem Mitha wrote: My usage is slightly non-standard - a foreign key pointing to a foreign key. that never worked, most likely. its very complicated to get the types to propagate up a chain like that, and all on a deferred execution, in a reasonable way.

[sqlalchemy] how to translate this sql

2010-07-27 Thread Jon Nelson
I have two questions: 1. I'm using postgresql, and I sometimes need to do column type conversions. In postgresql, this is normally done with the ::FOO operator where FOO is a data *type*. Somtimes, but not usually, these data types are also available in function-like factories, but in this case

[sqlalchemy] Problem with correlate in a subquery

2010-07-27 Thread Jesse
I'm having a problem when using correlate in a subquery. I figured I would throw it in here before logging a bug report incase this is just user error. I have two tables with a many-to-one relationship. Estimate has a list of EstimateLines on it. I want to select in the first EstimateLine that

Re: [sqlalchemy] how to translate this sql

2010-07-27 Thread Michael Bayer
On Jul 27, 2010, at 11:49 AM, Jon Nelson wrote: I have two questions: 1. I'm using postgresql, and I sometimes need to do column type conversions. In postgresql, this is normally done with the ::FOO operator where FOO is a data *type*. Somtimes, but not usually, these data types are also

Re: [sqlalchemy] Problem with correlate in a subquery

2010-07-27 Thread Michael Bayer
On Jul 27, 2010, at 12:03 PM, Jesse wrote: I'm having a problem when using correlate in a subquery. I figured I would throw it in here before logging a bug report incase this is just user error. I have two tables with a many-to-one relationship. Estimate has a list of EstimateLines on

Re: [sqlalchemy] how to translate this sql

2010-07-27 Thread Jon Nelson
On Tue, Jul 27, 2010 at 11:08 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 27, 2010, at 11:49 AM, Jon Nelson wrote: I have two questions: 1. I'm using postgresql, and I sometimes need to do column type conversions. In postgresql, this is normally done with the ::FOO operator

Re: [sqlalchemy] how to translate this sql

2010-07-27 Thread Jon Nelson
On Tue, Jul 27, 2010 at 11:35 AM, Jon Nelson jnel...@jamponi.net wrote: On Tue, Jul 27, 2010 at 11:08 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 27, 2010, at 11:49 AM, Jon Nelson wrote: I have two questions: 1. I'm using postgresql, and I sometimes need to do column type

[sqlalchemy] Re: SQLAlchemy NotImplementedError when doing a metadata create_all

2010-07-27 Thread Faheem Mitha
Hi Mike, On Tue, 27 Jul 2010 09:07:15 -0400, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 27, 2010, at 1:34 AM, Faheem Mitha wrote: My usage is slightly non-standard - a foreign key pointing to a foreign key. that never worked, most likely. its very complicated to get the types

[sqlalchemy] lazy = 'dynamic' and coercing AppenderQuery to a new object class

2010-07-27 Thread Zippy P
Hi all, I have the following: class Device(Base): ... source_id = Column(BigInteger, primary_key=True) ... class EventQuery(Query): def custommethod(): ... class Event(Base): __tablename__ = 'events' query = Session.query.property(query_cls = EventQuery) ... device_source_id =

Re: [sqlalchemy] how to translate this sql

2010-07-27 Thread Michael Bayer
On Jul 27, 2010, at 1:07 PM, Jon Nelson wrote: Michael - since VALUES is part of the SQL standard (as indicated here: http://www.postgresql.org/docs/8.4/static/sql-values.html ) perhaps values could be added to sqlalchemy in a future release? sure, something we could likely add to the

Re: [sqlalchemy] lazy = 'dynamic' and coercing AppenderQuery to a new object class

2010-07-27 Thread Michael Bayer
On Jul 27, 2010, at 1:23 PM, Zippy P wrote: Hi all, I have the following: class Device(Base): ... source_id = Column(BigInteger, primary_key=True) ... class EventQuery(Query): def custommethod(): ... class Event(Base): __tablename__ = 'events' query =