[sqlalchemy] Re: group_by and column labels

2007-06-08 Thread Huy Do
Michael Bayer wrote: On Jun 7, 2007, at 7:17 AM, Huy Do wrote: Michael Bayer wrote: put strings into group_by: group_by = [client_code, client_name, ...] Hi Michael, Sorry I'm not sure what you are suggesting. I don't really want to retype my column names again in the

[sqlalchemy] Re: group_by and column labels

2007-06-08 Thread Huy Do
Hi Rick, If this works, that is fine for me. I just don't want to retype my columns to avoid errors. I'll test and then send an update. Thanks Huy I think the .name property of a labled column holds the label, so how about db.job_table, db.client_table, db.service_type_table],

[sqlalchemy] Re: group_by and column labels

2007-06-08 Thread Huy Do
I think the .name property of a labled column holds the label, so how about db.job_table, db.client_table, db.service_type_table], group_by = [col.name http://col.name for col in group_by], This almost worked, but not quite. Using the name column, does give me the

[sqlalchemy] Re: autocloning vs returning self+explicit clone()

2007-06-08 Thread Michael Bayer
On Jun 8, 2007, at 9:54 AM, svilen wrote: i know this change is old, and the above SelectResults has been made to match Query() (cloning) behaviour, and whole SelectResults is abandoned, etc, but in this case the explicit is better than implicit would help to avoid such mess - if u wanna

[sqlalchemy] Re: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt

2007-06-08 Thread Michael Bayer
On Jun 8, 11:27 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello. I am receiving the error: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt 'INSERT INTO workorderlines (workorderlines_rowid) VALUES (% (workorderlines_rowid)s)' {'workorderlines_rowid':

[sqlalchemy] remember that polymorphic_union function ?

2007-06-08 Thread Michael Bayer
I know ive put many folks through the wringer dealing with this function, in order to get their inherited mappers to load instances polymorphically. It seems like we probably dont need it for the most common case, which is that you are using only joined-table inheritance from a single

[sqlalchemy] sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt

2007-06-08 Thread [EMAIL PROTECTED]
Hello. I am receiving the error: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt 'INSERT INTO workorderlines (workorderlines_rowid) VALUES (% (workorderlines_rowid)s)' {'workorderlines_rowid': Sequence('workorderlines_rowid_seq',start=None,increment=None,optional=False)} running

[sqlalchemy] Re: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt

2007-06-08 Thread A. Grossman
Hmmm. Perhaps I oversimplified my code for the example. The workorderlines_rowid isn't actually a primary key; given the following code where it is not one: from sqlalchemy import * db = create_engine('postgres://[EMAIL PROTECTED]:5432/fleettest') db.echo = True metadata = BoundMetaData(db)

[sqlalchemy] Re: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt

2007-06-08 Thread Michael Bayer
this syntax, from your example: Column('workorderlines_rowid', Numeric(10,0), default=Sequence('workorderlines_rowid_seq')), is wrong. that is why you are getting this: VALUES (%(company)s, %(store)s, %(barcode)s, % (workorder)s, %(line)s, %(suffix)s, % (workorderlines_rowid)s)' {'suffix':

[sqlalchemy] [MySQL] Checking if commit() is available

2007-06-08 Thread Andreas Jung
is there a way to determine if the underlying MySQL DB is able to perform a commit() operation? The following code fails (likely because the underlying MySQL db is pretty old, V3ish). Andreas -- dsn = 'mysql://' e = create_engine(dsn) c=e.connect() t = c.begin() t.commit()

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Rick Morrison
try: t.commit() except: print 'Holy cow, this database is lame' On 6/8/07, Andreas Jung [EMAIL PROTECTED] wrote: is there a way to determine if the underlying MySQL DB is able to perform a commit() operation? The following code fails (likely because the underlying MySQL db is pretty

[sqlalchemy] Re: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt

2007-06-08 Thread A. Grossman
Ahhh, PassiveDefault in that way worked. Excellent. Thank you. On Jun 8, 1:43 pm, Michael Bayer [EMAIL PROTECTED] wrote: this syntax, from your example: Column('workorderlines_rowid', Numeric(10,0), default=Sequence('workorderlines_rowid_seq')), is wrong. that is why you are getting

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Andreas Jung
--On 8. Juni 2007 14:05:39 -0400 Rick Morrison [EMAIL PROTECTED] wrote: try: t.commit() except: print 'Holy cow, this database is lame' This code is also lame :-) The code should work for arbitrary DSNs and swallowing an exception while committing is evil, evil, evil. -aj

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Rick Morrison
Well it's not so evil if all you're doing is testing to see if commit() is available -- I wasn't trying to suggest that it was a great pattern for your whole application. On 6/8/07, Andreas Jung [EMAIL PROTECTED] wrote: --On 8. Juni 2007 14:05:39 -0400 Rick Morrison [EMAIL PROTECTED] wrote:

[sqlalchemy] Re: sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt

2007-06-08 Thread Michael Bayer
On Jun 8, 2007, at 2:10 PM, A. Grossman wrote: Ahhh, PassiveDefault in that way worked. Excellent. Thank you. glad that worked. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-08 Thread Michael Bayer
On Jun 8, 2007, at 2:17 PM, Andreas Jung wrote: --On 8. Juni 2007 14:05:39 -0400 Rick Morrison [EMAIL PROTECTED] wrote: try: t.commit() except: print 'Holy cow, this database is lame' This code is also lame :-) The code should work for arbitrary DSNs and swallowing an

[sqlalchemy] Re: SA and pyodbc connections

2007-06-08 Thread Paul Johnston
Hi, For me, at least, solid and passes all tests are not necessarily the same thing This depends somewhat on your definition of solid. In terms of volumns, I think you're absolutely right, if your basic operation works, you can process millions of rows and it doesn't matter that other