ok, forgot my message ... I used .label() instead of .alias() >:O On Tue, 2007-09-25 at 12:16 +0200, Julien Cigar wrote: > Hello, > > I've a small problem, I try to translate this SQL query : > http://dpaste.com/20579/ into an SQLAlchemy query : > http://dpaste.com/20580/ > > However, I get the following error : > > >> group_by = [t_specimens.c.taxonomy_id] > Module sqlalchemy.sql:3009 in label > << def label(self, name): > if not self.is_scalar: > raise exceptions.InvalidRequestError("Not a scalar > select statement") > else: > return label(name, self)>> raise > exceptions.InvalidRequestError("Not a scalar select statement") > sqlalchemy.exceptions.InvalidRequestError: Not a scalar select statement > > I tried to add a scalar = True to the q_specimens select but it doesn't > work and I get another error (exceptions.AttributeError: '_Label' object > has no attribute 'corresponding_column') ... (Normally a scalar = True > is not needed in this case ..) > > Any idea what I did wrong ? > > In advance thanks, > Julien > > -- Julien Cigar Belgian Biodiversity Platform http://www.biodiversity.be Université Libre de Bruxelles (ULB) Campus de la Plaine CP 257 Bâtiment NO, Bureau 4 N4 115C (Niveau 4) Boulevard du Triomphe, entrée ULB 2 B-1050 Bruxelles Mail: [EMAIL PROTECTED] Tel : 02 650 57 52
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---