Re: [sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-06-06 Thread Horcle
This worked, btw. Thanks! On Wednesday, June 1, 2016 at 5:45:45 PM UTC-5, Horcle wrote: > > Ha! Yes, I should not have taken this literally. Will try tomorrow and let > you know the outcome. > > Thanks! > > On Wednesday, June 1, 2016 at 3:55:35 PM UTC-5, Mike Bayer wrote: >> >> there's no

Re: [sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-06-01 Thread Horcle
Ha! Yes, I should not have taken this literally. Will try tomorrow and let you know the outcome. Thanks! On Wednesday, June 1, 2016 at 3:55:35 PM UTC-5, Mike Bayer wrote: > > there's no "eager" strategy. you'd want something like lazy="joined" or > something like that. check the docs. > >

Re: [sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-06-01 Thread Mike Bayer
there's no "eager" strategy. you'd want something like lazy="joined" or something like that. check the docs. On 06/01/2016 04:19 PM, Horcle wrote: Hi Mike, Just verifying: Should class Patient(Model): encounters = relationship( "Encounter",

Re: [sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-06-01 Thread Horcle
Hi Mike, Just verifying: Should class Patient(Model): encounters = relationship( "Encounter", backref_populates='patient', lazy='dynamic') be class Patient(Model): encounters = relationship( "Encounter",

Re: [sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-05-31 Thread Horcle
Hi Michael, The backref/backpopulate was my attempt at cleaning this up, and I've obviously made more of a mess of it. (^_^) The patient_id as a FK (versus use of the PK from the patient table) was a deliberate choice for ease of getting the db up. It was indexed in the patient table on the db

Re: [sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-05-31 Thread Mike Bayer
you should use "dynamic" and your relationships are mis-configured with mis-use of the backref() construct, as you've constructed relationships on both sides that are mutual you'd use back_populates: class Encounter(Model): patient = relationship( "Patient",

[sqlalchemy] Re: Dealing with large collections in a scaffolded application

2016-05-31 Thread Horcle
I guess my question is: How can I efficiently load Patient and its related Encounters? I have tried various loading strategies of dynamic, joined (I would think this would be the desired option), subquery, no load, etc., and it these do not load. On the other hand, I can load Encounter just