>> 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 label, but it also only gives the column name, which is a problem when you have tables with the same column in the from clause (Ambiguous column error from the db server). The select column statement has "table.column_name" whilst the group by (using the method above) only has "column_name" or "label_name".
If i use use_labels option for the select statement, it works, because then the label names are unique across all columns. thanks Huy >> On 6/7/07, *Michael Bayer* <[EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]>> 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 group_by clause. >> > >> >> i was suggesting a workaround. >> >> > My intention was to be able to reuse the actual column list in the >> > group >> > by clause. >> >> would be easier if you can wait for 0.4 on that. >> >> >> >> > >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---