Alvaro Reinoso wrote:
> 
> It works out, thank you! How could I just retrieve some columns from
> both tables? For example, if I try to select some columns from Item
> and Channel, I get "<class 'sqlalchemy.util.NamedTuple'>" when I'd
> like to get a channel type with its items:
> 
> result = session.query(Channel.title,
> Item.title).join('items').filter(Item.typeItem == "zeppelin/
> channel").order_by(Channel.titleView).all()
> 
> I just need some values many times, I don't need to retrieve the whole
> object.
> 
> Thanks in advance!
> 

It sounds like you are looking for deferred column loading:

http://www.sqlalchemy.org/docs/mappers.html#deferred-column-loading

You can mark certain columns as not to be loaded until they are
accessed. This can be done at mapper definition time as well as at query
time.

Hope that helps,

Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to