[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Tom Torsney-Weir
-Original Message- From: sqlalchemy@googlegroups.com To: sqlalchemy Sent: Mon Feb 04 16:09:49 2008 Subject: [sqlalchemy] Oracle, limit, and polymorphism Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a week. I'm using version 4.2p3 on python 2.4 Anyways,

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Tom Torsney-Weir
-Original Message- From: sqlalchemy@googlegroups.com To: sqlalchemy Sent: Mon Feb 04 16:09:49 2008 Subject: [sqlalchemy] Oracle, limit, and polymorphism Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a week. I'm using version 4.2p3 on python 2.4 Anyways,

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Tom Torsney-Weir
-Original Message- From: sqlalchemy@googlegroups.com To: sqlalchemy Sent: Mon Feb 04 16:09:49 2008 Subject: [sqlalchemy] Oracle, limit, and polymorphism Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a week. I'm using version 4.2p3 on python 2.4 Anyways,

[sqlalchemy] Re: cherrypy, sqlachemy, mod_wsgi, and apache2

2008-02-04 Thread braydon fuller
Michael Bayer wrote: > there seems to be more going on there, but perhaps are all side effects of > the same thing: > > http://www.sqlalchemy.org/trac/wiki/FAQ#MySQLserverhasgoneawaypsycopg.InterfaceError:connectionalreadyclosed > > or otherwise your mysql client is not able to connect at all. I h

[sqlalchemy] Re: cherrypy, sqlachemy, mod_wsgi, and apache2

2008-02-04 Thread braydon fuller
Michael Bayer wrote: > there seems to be more going on there, but perhaps are all side effects of > the same thing: > > http://www.sqlalchemy.org/trac/wiki/FAQ#MySQLserverhasgoneawaypsycopg.InterfaceError:connectionalreadyclosed > > or otherwise your mysql client is not able to connect at all. I h

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Michael Bayer
On Feb 4, 2008, at 4:29 PM, Richard Levasseur wrote: > > After going through the bugs, i found this: > http://www.sqlalchemy.org/trac/ticket/941 > > Using the trunk version from svn ( r4118 ) seems to have fixed the > issue (the real ticket_type column's name was very long). > glad you could fi

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Richard Levasseur
After going through the bugs, i found this: http://www.sqlalchemy.org/trac/ticket/941 Using the trunk version from svn ( r4118 ) seems to have fixed the issue (the real ticket_type column's name was very long). On Feb 4, 1:09 pm, Richard Levasseur <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm ra

[sqlalchemy] Oracle, limit, and polymorphism

2008-02-04 Thread Richard Levasseur
Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a week. I'm using version 4.2p3 on python 2.4 Anyways, I've run into a problem when I use oracle with joined inheritance with a limit clause, specifically, it can't seem to find the polymorphic_on column. If I switch th

[sqlalchemy] Re: Ordering by related column's related column

2008-02-04 Thread Utku Altinkaya
On Feb 4, 11:03 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Feb 4, 2008, at 3:46 PM, Utku Altinkaya wrote: > > > > > I get it, the result with joins for eager loading has nothing to do > > with sorting. So I have to join them to base selected set to use. But > > I feel like selecting twice

[sqlalchemy] Re: New records won't be committed (ORM, Elixir)

2008-02-04 Thread Michael Bayer
On Feb 4, 2008, at 4:01 PM, Felix Schwarz wrote: > > jason kirtland wrote: >> SA won't automatically commit a transaction you've begun. You need >> to .commit() explicitly. As Michael said, .commit() will flush >> changes in the session before committing, so you could switch to >> callin

[sqlalchemy] Re: Ordering by related column's related column

2008-02-04 Thread Michael Bayer
On Feb 4, 2008, at 3:46 PM, Utku Altinkaya wrote: > > > > > I get it, the result with joins for eager loading has nothing to do > with sorting. So I have to join them to base selected set to use. But > I feel like selecting twice, is there a peformance penalty here? > > properties = > properties

[sqlalchemy] Re: New records won't be committed (ORM, Elixir)

2008-02-04 Thread Felix Schwarz
jason kirtland wrote: SA won't automatically commit a transaction you've begun. You need to .commit() explicitly. As Michael said, .commit() will flush changes in the session before committing, so you could switch to calling that. It can be useful in a transaction to issue a simple .flush()

[sqlalchemy] Re: Ordering by related column's related column

2008-02-04 Thread Utku Altinkaya
On Feb 4, 8:13 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Feb 4, 2008, at 11:29 AM, Utku Altinkaya wrote: > > > > > Greetings, > > > I have Users class with relation to Address which have relation to > > Cities, all are eager loaded. I want to sort the Users query with the > > name field

[sqlalchemy] Re: New records won't be committed (ORM, Elixir)

2008-02-04 Thread jason kirtland
Felix Schwarz wrote: > > Thank you very much for your reply - lightning fast as always :-) > > Gaetan de Menten schrieb: >> Other than that, maybe you are (or Turbogears is) >> starting a transaction somewhere (with session.begin()) without ever >> commiting it? > > Thanks for your hint. Indee

[sqlalchemy] Re: Ordering by related column's related column

2008-02-04 Thread Michael Bayer
On Feb 4, 2008, at 11:29 AM, Utku Altinkaya wrote: > > Greetings, > > > I have Users class with relation to Address which have relation to > Cities, all are eager loaded. I want to sort the Users query with the > name field of the cities table. But if I order by City.name the cities > table is j

[sqlalchemy] Re: New records won't be committed (ORM, Elixir)

2008-02-04 Thread Michael Bayer
On Feb 4, 2008, at 8:01 AM, Felix Schwarz wrote: > > > Thank you very much for your reply - lightning fast as always :-) > > Gaetan de Menten schrieb: >> Other than that, maybe you are (or Turbogears is) >> starting a transaction somewhere (with session.begin()) without ever >> commiting it? > >

[sqlalchemy] Ordering by related column's related column

2008-02-04 Thread Utku Altinkaya
Greetings, I have Users class with relation to Address which have relation to Cities, all are eager loaded. I want to sort the Users query with the name field of the cities table. But if I order by City.name the cities table is joined to the actual query. How can I explain it to use the cities.n

[sqlalchemy] Re: New records won't be committed (ORM, Elixir)

2008-02-04 Thread Felix Schwarz
Thank you very much for your reply - lightning fast as always :-) Gaetan de Menten schrieb: > Other than that, maybe you are (or Turbogears is) > starting a transaction somewhere (with session.begin()) without ever > commiting it? Thanks for your hint. Indeed I used session.begin() after my se

[sqlalchemy] Re: How do I Instantiate a class with an Auto-assigned Key ID

2008-02-04 Thread King Simon-NFHD78
Hi, If your database is set up to generate auto-incrementing primary keys on INSERT (such as a MySQL auto-incrementing column), then SA will retrieve the new value when the object is flushed to the database. When the object is constructed, the primary key will be None until you flush the session,

[sqlalchemy] Re: New records won't be committed (ORM, Elixir)

2008-02-04 Thread Gaetan de Menten
On Feb 4, 2008 12:08 PM, Felix Schwarz <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm chasing a very nasty bug in my TurboGears-Application > (using SQLAlchemy r4116, Elixir 0.5): I create a new object > and flush that session (ScopedSession) but there is no COMMIT > issued and therefore the data is n

[sqlalchemy] New records won't be committed (ORM, Elixir)

2008-02-04 Thread Felix Schwarz
Hi, I'm chasing a very nasty bug in my TurboGears-Application (using SQLAlchemy r4116, Elixir 0.5): I create a new object and flush that session (ScopedSession) but there is no COMMIT issued and therefore the data is never saved in the database. Interestingly, I can retrieve the new record via E

[sqlalchemy] Re: How do I Instantiate a class with an Auto-assigned Key ID

2008-02-04 Thread Jorge Godoy
jdcman wrote: > As I add records, I want the ID to Auto Increment. When you say > "define a constructor for your class which does not require an ID", > but I REQUIRE an ID, I also require the ID to increment when I add > new record. You went on to say "SQLALchemy has no constructor > requir