Re: [sqlalchemy] Is there any way to get around the "redundancy" of coupled .join and contains_eager chains?

2018-09-30 Thread seaders
Any further thought on the above at all? Reason I ask is because I still regularly get caught / frustrated with situations similar to this, and am going to rock my own solution, with my own branch of sqlalchemy. If I get it to a "happy" and good enough state, I'd also be happy to PR it back

Re: [sqlalchemy] How to force the engine to "glue" objects together the way it does when you run a query?

2018-09-30 Thread seaders
Gah! That's it, make_transient_to_detached does everything as you said. I do truly only need "simple" loading on my objects, anything that has a many-to-many relationship (they're in 3 separate areas), which would require a separate dB call normally, I just set those manually. Thanks Mike.

Re: [sqlalchemy] How to force the engine to "glue" objects together the way it does when you run a query?

2018-09-30 Thread Mike Bayer
On Sun, Sep 30, 2018 at 9:39 AM seaders wrote: > > Well, here's my solution that works exactly the way I want it, > > @classmethod > def from_flat_json(cls, d=None, db_enable_relationship_loading=True, >**kwargs): > # noinspection PyArgumentList > new_instance =

Re: [sqlalchemy] How to force the engine to "glue" objects together the way it does when you run a query?

2018-09-30 Thread seaders
Well, here's my solution that works exactly the way I want it, @classmethod def from_flat_json(cls, d=None, db_enable_relationship_loading=True, **kwargs): # noinspection PyArgumentList new_instance = cls(**d, **kwargs) state = instance_state(new_instance)