Re: [sqlalchemy] TypeDecorators don't know which database session to use

2019-05-30 Thread Mike Bayer
On Tue, May 28, 2019, at 9:10 AM, Chris Wilson wrote: > Dear Michael, > > I have discovered a limitation of TypeDecorators (custom column types): any > one that uses the database (e.g. to load objects serialised in a custom way) > has no way to know which database session to use. During

Re: [sqlalchemy] Re: TypeDecorators don't know which database session to use

2019-05-30 Thread Mike Bayer
On Thu, May 30, 2019, at 9:21 AM, Mike Bayer wrote: > > > On Thu, May 30, 2019, at 8:42 AM, Chris Wilson wrote: >> Hi Mike, >> >> On Wed, 29 May 2019 at 15:30, Mike Bayer wrote: >>> Note that we suggested approaches that work in conjunction with the >>> serialized approach you gave, the

Re: [sqlalchemy] Re: TypeDecorators don't know which database session to use

2019-05-30 Thread Mike Bayer
On Thu, May 30, 2019, at 8:42 AM, Chris Wilson wrote: > Hi Mike, > > On Wed, 29 May 2019 at 15:30, Mike Bayer wrote: >> Note that we suggested approaches that work in conjunction with the >> serialized approach you gave, the @property approach and the mapper.load() >> event approach. > >

Re: [sqlalchemy] Re: TypeDecorators don't know which database session to use

2019-05-30 Thread Chris Wilson
Hi Mike, On Wed, 29 May 2019 at 15:30, Mike Bayer wrote: > Note that we suggested approaches that work in conjunction with the > serialized approach you gave, the @property approach and the mapper.load() > event approach. > Unfortunately I think they would both require massive code

Re: [sqlalchemy] Filter query. Exclude some records by related model

2019-05-30 Thread kosta
Hello Simon! Thank you a lot, your solution was helping me out. среда, 29 мая 2019 г., 14:38:28 UTC+3 пользователь Simon King написал: > > On Wed, May 29, 2019 at 11:46 AM kosta > > wrote: > > > > Hi everyone! > > > > I can't solve my issue by myself, could anyone has advice on this. > >

Re: [sqlalchemy] Child table with 2 relationships to parent

2019-05-30 Thread Simon King
I think everything you have said is correct. If you use "relationship" to create a link from class A to class B, then "backref" is just a shortcut to create a corresponding relationship in the other direction, from B to A. They are entirely optional; you don't have to create a backref if you don't