[sqlalchemy] Re: select and join functions

2009-06-04 Thread santhosh kumar
Thanks Bastian it works, but i facing another problem while passing select query object to pagination. Even i am filling *sqlalchemy_session *parameter too. I am getting following exception *TypeError: If you want to page an SQLAlchemy 'select' object then you have to provide a 'sqlalchemy_session

[sqlalchemy] Re: select and join functions

2009-06-04 Thread Bastian
You supplied the join() as a the whereclouse (2nd) parameter to the select method. This should work: select([tags_table.c.name,tags_table.c.id, func.count (deal_tags_table.c.dealid).label('dealcount')], from_obj=join(tags_table, deal_tags_table),group_by=[deal_tags_table.c.dealid]) Regards Bast

[sqlalchemy] Re: Creating a Dialect for Amazon SimpleDB

2009-06-04 Thread az
sorry to tune in late, but how different is AmazonDB from googleDB? googleDB seems like a plain non-relational DB like berkeleyDB/btrieve kind of thing. to map a relational and non-relational schemas in same way u need higher level of abstraction - sqlalchemy is only about sql. so i had an ide

[sqlalchemy] Re: Creating a Dialect for Amazon SimpleDB

2009-06-04 Thread Laurence Rowe
Without Foreign Keys or joins, I don't see how putting all tables in the same domain buys you anything? Laurence On Jun 4, 12:27 am, enj wrote: > The way Simpledb works you don't want to make each domain a table, you > want to put all related tables in one domain. This way you can do > relation

[sqlalchemy] Re: Query -> column names

2009-06-04 Thread George Sakkis
On Jun 4, 5:09 am, "King Simon-NFHD78" wrote: > George Sakkis wrote: > > > Is there a (public) API for getting the column names of a given Query > > instance and other similar introspection needs  ? I didn't find > > anything related in the docs but after digging in the code I came up > > with >

[sqlalchemy] Re: Query -> column names

2009-06-04 Thread George Sakkis
Thanks, didn't know that, though in this case I want the keys in the same column order but keys() doesn't preserve it. George On Jun 3, 8:59 pm, Michael Bayer wrote: > each row has a keys() attribute if that helps... > > On Jun 3, 2009, at 8:49 PM, George Sakkis wrote: > > > > > Is there a (pub

[sqlalchemy] Re: SqlAlchemy reflection error in TurboGears 2

2009-06-04 Thread Mike Driscoll
Hi Simon and Michael, On Jun 4, 8:03 am, "King Simon-NFHD78" wrote: > Mike Driscoll wrote: > > > Well, I did the fake id column because SA was throwing an error on a > > the reflected table since it didn't have a primary key defined. I > > think I may have found a workaround though. > > From SA'

[sqlalchemy] Re: MySQL has gone away (again)

2009-06-04 Thread Michael Bayer
the connection went from good to dead within a few seconds (assuming SQL was successfully emitted on the previous checkout). Your database was restarted or a network failure occurred. Kamil Gorlo wrote: > > Hi, > > I know this problem shows on group from time to time, but suggested > solutions

[sqlalchemy] MySQL has gone away (again)

2009-06-04 Thread Kamil Gorlo
Hi, I know this problem shows on group from time to time, but suggested solutions does not work for me (pool_recycle). Here is my situation: 1. I am using SQLAlchemy 0.4.7p1-2 from Pylons 0.9.6.2-2 on Debian Lenny (xen-amd64) 2. From time to time I see in logs: "MySQL has gone away" and this is

[sqlalchemy] select and join functions

2009-06-04 Thread santhoshkumar.subram...@gmail.com
I have two tables "tags" and "deal_tag", and table definition follows, Table('tags', metadata, Column('id', types.Integer(), Sequence('tag_uid_seq'), primary_key=True), Column('name', types.String()), ) Table('deal_tag', metadata, Column('dealid', types.In

[sqlalchemy] Re: SqlAlchemy reflection error in TurboGears 2

2009-06-04 Thread King Simon-NFHD78
Mike Driscoll wrote: > > Well, I did the fake id column because SA was throwing an error on a > the reflected table since it didn't have a primary key defined. I > think I may have found a workaround though. >From SA's point of view, the primary key just has to be a set of columns that uniquely

[sqlalchemy] Re: SqlAlchemy reflection error in TurboGears 2

2009-06-04 Thread Mike Driscoll
Well, I did the fake id column because SA was throwing an error on a the reflected table since it didn't have a primary key defined. I think I may have found a workaround though. Thanks for the help. Mike On Jun 3, 5:05 pm, "Michael Bayer" wrote: > i don't see what the purpose of a "fake id co

[sqlalchemy] Re: Query -> column names

2009-06-04 Thread King Simon-NFHD78
George Sakkis wrote: > > Is there a (public) API for getting the column names of a given Query > instance and other similar introspection needs ? I didn't find > anything related in the docs but after digging in the code I came up > with > col_names = [e._result_label for e in q._entities] >

[sqlalchemy] Manage Session

2009-06-04 Thread Ghido
Hi all, i have a problem on manage the sessions. I whish to insert 2 object on my database: obj1 = machine() obj2 = action() i want to insert one machine and reuse the id of the machine for insert the action, this part is ok: config.Sess.add(obj1) config.Sess.commit() return config.Sess.refresh