On Feb 21, 11:22 pm, Alexandre da Silva <[EMAIL PROTECTED]> wrote:
> Em Qui, 2008-02-21 às 11:51 -0800, Michael Bayer escreveu:> Elixir is
> probably using a backref for the bi-directional
> > relationship
>
> yes, as I was testing I got the same.
> but I think Elixir does not need to create the backref, in this case,
> because I am creating the "person" column on goal, and this supplies the
> relationship.
> I think maybe Elixir is doing something unnecessary here.
>
> class Goal(Entity):
> person = ManyToOne('Person')
>
> class Person(Entity):
> goals = OneToMany('Goal')
>
> and other... why it does not throw an exception by duplicated attribute,
> since that the auto created backref should be exactly "person"?
>
its creating the "person" backref in response to your
ManyToOne('Person') call. I.e. it detects that "goals" and "person"
are two sides of the same coin and sets them up as a backref. So if
you removed "person" then there wouldn't be a backref. Perhaps theres
an option to keep them as non-connected relations.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---