Re: [sqlalchemy] Parameterized "Relationships" with Eager Loading Capability

2021-02-04 Thread agrot...@gmail.com
big deal but you probably dont want to be making > these classes on the fly. mapping a class is not a quick operation > internally, it's messy and somewhat questionable in highly concurrent > situations. > > > On Wed, Sep 23, 2020, at 9:30 PM, agrot...@gmail.com wrote:

[sqlalchemy] Parameterized "Relationships" with Eager Loading Capability

2020-09-22 Thread agrot...@gmail.com
Let's say I have a model with a one to many relationship as such: class A(Base): id = ... class B(Base): id = ... some_field = a_id = Column(ForeignKey(A.id)... a = relationship(A, backref=backref('bs', lazy='dynamic')) I can define a method on A: class A(Base): ... def get_b_with_some_field

Re: [sqlalchemy] Parameterized "Relationships" with Eager Loading Capability

2020-09-23 Thread agrot...@gmail.com
ed, Sep 23, 2020, at 5:43 AM, agrot...@gmail.com wrote: > > Let's say I have a model with a one to many relationship as such: > class A(Base): > id = ... > > class B(Base): > id = ... > some_field = > a_id = Column(ForeignKey(A.id)... > a = relationship(A, back

Re: [sqlalchemy] Parameterized "Relationships" with Eager Loading Capability

2020-09-23 Thread agrot...@gmail.com
> On Wed, Sep 23, 2020, at 4:17 PM, agrot...@gmail.com wrote: > > I actually don't really care that much to have the attribute remain > dynamic. In fact there is only one *specific* filtering that I want to > apply to it, but that filtering will vary from (web) request to (web) &

Re: [sqlalchemy] Parameterized "Relationships" with Eager Loading Capability

2020-09-23 Thread agrot...@gmail.com
rloading > that puts the collection on some other arbitrary place. > > On Wed, Sep 23, 2020, at 6:03 PM, agrot...@gmail.com wrote: > > Cool, yes I think that is what I am looking for. Is there any way to alias > the relationship (as read only) to: 1. allow for multiple differen

Re: [sqlalchemy] Parameterized "Relationships" with Eager Loading Capability

2020-09-23 Thread agrot...@gmail.com
ect that's not associated with a class-level > mapped attribute. > > I think this problem long term would be solved more through some kind of > @property selector that works from a class and is not specific to > mapping. > > On Wed, Sep 23, 2020, at 8:51 PM, agrot..