[sqlalchemy] PostgreSQL and inserting

2008-06-06 Thread Cliff Wells
Just an FYI, in PostgreSQL 8.2.4 they added a new feature returning which can be used to avoid the need for an additional query (to get the value of serial columns) when inserting records: test=# create table foo ( id serial primary key not null, name text ); test=# insert into foo ( name )

[sqlalchemy] using datetime objects in queries

2008-01-31 Thread Cliff Wells
I'm using SA 0.4 and Pylons 0.9.6. Why would this: def by_date ( self, year, month, day ): post_q = Session.query ( Post ) start_date = datetime ( int ( year ) , int ( month ), int ( day ) ) end_date = start_date + timedelta ( 1 ) c.post_index = post_q.filter ( and_ ( [

[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread Cliff Wells
at 12:41 -0800, Cliff Wells wrote: I'm using SA 0.4 and Pylons 0.9.6. Why would this: def by_date ( self, year, month, day ): post_q = Session.query ( Post ) start_date = datetime ( int ( year ) , int ( month ), int ( day ) ) end_date = start_date + timedelta ( 1

[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread Cliff Wells
the types.DateTime makes it work as well. I'd think that would be a bit less confusing to users. Regards, Cliff On Jan 31, 2008, at 4:02 PM, Cliff Wells wrote: This appears to be a bug in SA 0.4.2p3: From the datetime docs: ''' Note: In order to stop comparison from falling back

[sqlalchemy] Re: Postgre e pg_largeobject

2007-01-17 Thread Cliff Wells
On Wed, 2007-01-17 at 11:45 +0100, Antonio wrote: Hi all, I'm trying to read a pdf file saved in a postgresql table : and now, how can I retrieve the file (res.pdf.data) in a file or send it as output in a html page (sendig the right headers) ? Antonio, I did a very similar thing (storing