le 22.06.2007 21:00 alex bodnaru a écrit:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> hi,
>
> that's expected. tg does it itself, but in console you have to.
>
>
I know that TG does an automatic flush when the method/page encounter no
error. But the problem here is that when I was using plain
activemapper/assignmapper syntax, if I did a p.group = g, g.persons was
immediately updated... I mean before any flush...
Same on the other way (setting g.persons updated immediately all the
p.group attributs)
> alex
>
> remi jolin 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)
>>
>> Of course, if I flush the datas to the DB, clear the session and then
>> get the group, (g=Group.get_by(name='g')), g.persons is OK.
>>
>>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---