I posted the concern about duplicate relations on the SqlAlchemy mailing list. 
This is Michael Bayer's reply:

OK, thanks very much for pointing this one out, as it came across a big
heap of egregious cruft in the backref code which I graciously
flattened (it even included the phrase "if not x is not None"...so
embarrassing...).  It also raised a few surprises as there were a very
small number of unit tests that were actually defining conflicting
properties in this manner...so when people upgrade to 0.4.1 some people
might get a few surprises (that alone makes it more controversial of a
candidate for the 0.3 series, which is in "maintenance" mode). 
changeset is rev 3660.

Very nice. Thanks, Mike!

Barry

----- Original Message ----
From: Barry Hart <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, October 24, 2007 3:59:18 PM
Subject: [TurboGears] Re: How to choose between Elixir and plain SQLAlchemy


Yes, even an arbitrary rule is fine as long as you're consistent. Just watch 
out when you rename a table. :-)

When I first started working with SqlAlchemy I wrote some automated checks to 
detect certain problems that kept tripping me up. You could do something 
similar for duplicate relations.

Barry

----- Original Message ----
From: Ben Sizer <[EMAIL PROTECTED]>
To: TurboGears <[email protected]>
Sent: Wednesday, October 24, 2007 5:10:23 AM
Subject: [TurboGears] Re: How to choose between Elixir and plain SQLAlchemy



On Oct 24, 1:23 am, Barry Hart <[EMAIL PROTECTED]> wrote:
> >unpleasant, for 2 reasons: firstly, because of the unintuitive
 backref
> >stuff which seemed to allow a reference to be accidentally declared
> >twice under different names, and secondly because it specifies the
>
> I have learned you always want to declare the relationship on the
 parent object of a relationship.

And what about situations where there is no parent? :)  I suppose I
could just put it on the one that came first in the alphabetical
order...! A lot of my objects aren't in some sort of composition
hierarchy but are actually just loosely associated, and that can make
it a bit awkward to decide where to put the links. Oh well, it's not
insurmountable.

--
Ben Sizer









__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 









__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to