On Thursday 06 September 2007 23:03:35 Lukasz Szybalski wrote: > Hello, > So it seems to me there are two select function that I can use but > they are different > First: > s=Users.select(Users.c.LASTNAME=='Smith') > but when you want to select only two columns via : > s=Users.select([Users.c.LASTNAME, Users.c.FIRSTNAME], > Users.c.LASTNAME =='Smith') > > you get an error : > File > "/usr/lib/python2.4/site-packages/sqlalchemy/ext/assignmapper.py", > line 7, in do > return getattr(query, name)(*args, **kwargs) > TypeError: select() takes at most 2 arguments (3 given)
> > > Second: > > import sqlalchemy > s2=sqlalchemy.select(Users.c.LASTNAME=='Smith') > s3=s2.execute() > This works just fine: > s2=sqlalchemy.select([Users.c.LASTNAME, Users.c.FIRSTNAME], > Users.c.LASTNAME =='Smith') > s3=s2.execute() > > Is this difference suppose to be there? or is it a bug in > assign_mapper? > > Lucas the first is the ORM query().select() taking only where clause, the second is plain sql select(columns,where,from). To disambiguate, first one is discontinued and is replaced by filter(). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---