[sqlalchemy] Regarding the use of reciprocal relationships

2014-07-01 Thread Ken Lareau
Related to one of my recent posted threads here, I'm recalling a certain conversation at PyCon where I was mentioning how a friend would define a many-to-many relationship by defining a relationship on both declarative classes involved, each pointing to the other, and the look of abject horror I

Re: [sqlalchemy] Regarding the use of reciprocal relationships

2014-07-01 Thread Mike Bayer
On 7/1/14, 4:54 PM, Ken Lareau wrote: Related to one of my recent posted threads here, I'm recalling a certain conversation at PyCon where I was mentioning how a friend would define a many-to-many relationship by defining a relationship on both declarative classes involved, each pointing to

Re: [sqlalchemy] Regarding the use of reciprocal relationships

2014-07-01 Thread Ken Lareau
On Tue, Jul 1, 2014 at 2:17 PM, Mike Bayer mike...@zzzcomputing.com wrote: On 7/1/14, 4:54 PM, Ken Lareau wrote: Related to one of my recent posted threads here, I'm recalling a certain conversation at PyCon where I was mentioning how a friend would define a many-to-many relationship by

Re: [sqlalchemy] Regarding the use of reciprocal relationships

2014-07-01 Thread Jonathan Vanasco
If it's just, you want to set up the two relationships as explicit code for readability, that's great, use back_populates. This is probably how apps should be doing it anyway, in the early SQLAlchemy days there was a lot of pressure to not require too much boilerplate, hence backref.