The column is available as e.Namefile, no need to subscript with numbers.


On Mon, Sep 28, 2009 at 6:07 AM, Christian Démolis <
christiandemo...@gmail.com> wrote:

> Hi everybody,
>
> I have a little problem with session.query.
> I try to optimize my queries with only attributes that i need.
>
> When we impose attribute, sqlalchemy return a rowtuple
> s = session.query(IdFile, NameFile)
> When we don't impose attribute, the return is the object
> s = session.query(File)
>
> Is it possible to obtain an sql alchemy object  instead of rowtuple when we
> impose attributes???
> I need it to avoid  write this in my code
> for e in s:
>    print e[0]
>
> it's more difficult to read than
> for e in s:
>    print e.NameFile
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to