Hi,

On Sun, Jan 4, 2009 at 7:18 AM, robert rottermann <rob...@redcor.ch> wrote:

>
> hi there
> I have a class tblMembershiptypeTable which I defind using declarative
> notation
>
> whereas
> t = tblMembershiptypeTable.__table__
> mt = session.execute(select(t, t.c.name == mtype)).fetchone()
>
> returns a tuple of values.
>
> how can I use select to return instances?
>

You don't really unless you roll it yourself.  But why would you do that.
That's what the ORM is for.  When you're using select() you're using the SQL
Expression Language which is not mapped in any way to Objects.  With the ORM
it knows the mapping through the Mapper and handles that.
I guess a larger question is what are you not able to achieve with the ORM
that you can achieve with the SQL Expression Language?

-- 
Michael Trier
http://blog.michaeltrier.com/
http://thisweekindjango.com/

--~--~---------~--~----~------------~-------~--~----~
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