On 6/22/07, remi jolin <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I've just started a new TG project and took the opportunity to switch to
> Elixir.
> Perhaps this issue has been raised before, but I could not find anything
> related.

>
> suppose we have a couple of objects defined as
> class Person(Entity):
>     has_field('name', Unicode(32))
>     belongs_to('group', of_kind='Group')
>
> class Group(Entity):
>     has_field('name', Unicode(32))
>     has_many('persons', of_kind='Person')
>
> under tg-admin shell I define
> p1 = Person(name='p1')
> g = Group(name='g')
> p1.group=g
>
> now, if I ask for g.persons, I get a [] which is not what I expected...
> Is this the normal behavior ?? (Elixir 0.3.0)

This is a (known) bug in Elixir. The cause is that we don't setup
backrefs as we should.

As I said to André Felipe Dias:
======
Feel free to work on a patch, though I'm not sure how hard it would
be. Basically, when a relationship has an inverse, it must setup a
backref. The catch is that you must catch all the arguments of the
inverse relationship and pass them through to the backref.
======
-- 
Gaëtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to