Re: [sqlalchemy] Self referential table, with composite key, and relationship(..., lazy='joined') is not eager loading as expected.

2016-03-13 Thread Devin Jacobs
I'm going to link the docs for easy reference for any future readers:  
http://docs.sqlalchemy.org/en/latest/orm/self_referential.html?highlight=join_depth#configuring-self-referential-eager-loading

I ended up using something link

session.query(Game).options(joinedload(Game.opp))

because I didn't want to settle on one specific join_depth.

Thank you for your suggestion. I was able to solve my issue because of fit. 
I am very happy with the abstractions available in SQLAlchemy to help with 
eager loading.

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


[sqlalchemy] Does dynamic loading effect speed?

2016-03-13 Thread Kate Boelhauf
I just learned about dynamic loading and was able to implement that so that 
I could filter on a relationship

matched_objects = foo.relationship.filter(RelationshipClass.property 
=="mustmatch").all()
if len(matched_objects) > 0:
continue

Currently I typically loop and check to see if the property matches, I'd 
prefer to do the dynamic loading but was wondering if I would take a 
penalty on speed if I used it a lot.

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