Hi everyone!

I have asked this question on StackOverflow, please see it for full detail 
of how the models are laid 
out: 
http://stackoverflow.com/questions/36463623/optimally-access-an-sqlalchemy-model-paramater-n-number-of-relationships-away

I have some "test" models that all have a relationship back to a "location" 
model, each a varying number of relationships away. When I want to get the 
name of the "location" associated with a "test", there is a ton of SQL 
emitted. Is it possible to build in some sort of shortcut to the location 
relationship?

I have tried setting the 'lazy' parameter on the relationship to 'select', 
'joined', and 'subquery' although these do not seem to make a significant 
difference when it comes to tying a test model to its location.

The way I have things defined also make it difficult for me to filter a 
group of tests based on their location, since the relationship is so 
different with each. I do not even know how to join these tables using raw 
SQL or how to begin to approach trying to emulate what the ORM is 
constructing for me.

I would imagine that this has been nailed before and am hoping that one of 
you out there can fill me in on the missing concept.


 - Brian

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to