[sqlalchemy] Backrefs vs. defining the relationships by hand

2011-02-24 Thread Hector Blanco
Hello everyone... I'd like to know what do you think it's better: Whether using backrefs or manually defining the relationships one by one. Are the backrefs useful to code less code or do they have other advantages? I.e.: Let's say I have a User and a UserGroup class with (initially) the

Re: [sqlalchemy] Backrefs vs. defining the relationships by hand

2011-02-24 Thread Michael Bayer
On Feb 24, 2011, at 1:20 PM, Hector Blanco wrote: Hello everyone... I'd like to know what do you think it's better: Whether using backrefs or manually defining the relationships one by one. Are the backrefs useful to code less code or do they have other advantages? I.e.: Let's say I

Re: [sqlalchemy] Backrefs vs. defining the relationships by hand

2011-02-24 Thread Hector Blanco
It was a typo! :-) They keep the two sides of a relationship in sync on the python side. I was suspecting using backrefs was better and that it would do some kind of synchronization like that, yeah... But I was hoping that someone would say No, it's the same... Because now I won't sleep soundly