[sqlalchemy] Re: Choosing a few columns out a query object

2007-07-25 Thread Michael Bayer
On Jul 25, 2007, at 8:51 AM, alex.schenkman wrote: > > I see the difference between getting an object (with all the columns) > and doing an SQL statement. > As fas as I can see, yes it is bounded. > > The code is: > > from sqlalchemy import * > > metadata = MetaData() > docs = Table('docs', meta

[sqlalchemy] Re: Choosing a few columns out a query object

2007-07-25 Thread svilen
> from sqlalchemy import * > > metadata = MetaData() > docs = Table('docs', metadata) > docs.append_column(Column('DocID', Integer, primary_key=True)) > docs.append_column(Column('Path', String(120))) > docs.append_column(Column('Complete', Boolean)) > > class Doc(object): > def __init__(self,

[sqlalchemy] Re: Choosing a few columns out a query object

2007-07-25 Thread alex.schenkman
I see the difference between getting an object (with all the columns) and doing an SQL statement. As fas as I can see, yes it is bounded. The code is: from sqlalchemy import * metadata = MetaData() docs = Table('docs', metadata) docs.append_column(Column('DocID', Integer, primary_key=True)) doc

[sqlalchemy] Re: Choosing a few columns out a query object

2007-07-25 Thread svilen
On Wednesday 25 July 2007 15:01:59 alex.schenkman wrote: > Hello: > > How do I get only a few columns from a query object? > > q = session.query(Document).select_by(Complete=False) > > would give me a list of rows (all columns) where Complete == False. this would give u a list of objects, not rows