when you call select() off a Table, it selects all columns; the  
method does not accept a list of columns.  to select only a subset of  
columns, do:

select([users.c.login]).execute().fetchall()


On Sep 18, 2006, at 4:24 AM, Enrico Morelli wrote:

> Ok, the problem is very strange. Each select with more than a WHERE
> clause, raise an exception. I use SQLAlchemy 0.2.8.
>
>>>> from sqlalchemy import *
>>>> engine=create_engine('postgres://[EMAIL PROTECTED]/DB')
>>>> metadata=BoundMetaData(engine)
>>>> users=Table('users',metadata, autoload=True)
>
>>>> users.select([users.c.login]).execute().fetchall()
> AttributeError: 'list' object has no attribute 'accept_visitor'
>
>>>> users.select([users.c.login],users.c.name=='myname').execute()
> TypeError: select() takes at most 2 arguments (3 given)
>
>>>> users.select([users.c.login], users.c.name=='enrico',
>      order_by=['login']).execute()
> TypeError: select() takes at most 2 non-keyword arguments (3 given)
>
>
> Can I do to solve the problem?
>
> Thanks
> -- 
> -------------------------------------------------------------------
>        (o_
> (o_    //\  Coltivate Linux che tanto Windows si pianta da solo.
> (/)_   V_/_
> +------------------------------------------------------------------+
> |     ENRICO MORELLI         |  email: [EMAIL PROTECTED]       |
> | *     *       *       *    |  phone: +39 055 4574269             |
> |  University of Florence    |  fax  : +39 055 4574253             |
> |  CERM - via Sacconi, 6 -  50019 Sesto Fiorentino (FI) - ITALY    |
> +------------------------------------------------------------------+
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to