Hey all,

I'm quite new to SQLAlchemy and I've been struggling to get the following 
to work.

When one queries with specific entities, the resulting namedTuples might 
have overlapping keys.
e.g. 

    sample = session.query(
            Sample.id,
            Experiment.id
        ).\ 
        join(Experiment).\
        filter(Experiment.active==1).\
        distinct().\
        first()
     print sample.id # will print experiment.id

So, how do access conflicting attributes?
I know I can use Sample.id.label('sample_id'), but I would prefer to have 
this in an automatic way. Much in the same way as the function 
with_labels() works on the query object, but then bubbling through to the 
actual result.
Any suggestions would be welcome!

wkr,
Kenny
ps: I am using SQLALchemy 0.7.3

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/1pS4YZujF-sJ.
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