On 8/9/06, remi jolin <remi.jolin@...> wrote:
> Let's take this simple example
> Mainly photo albums with photos in them...
>
> Classes.csv :
> "Class","Attribute","Type","Copy","IsRequired","Min","Max","Extras"
> "Album",,,,,,,
> ,"name","string",,1,,50,"isUnique"
> ,"photos","list of Photo",,,,,"onDeleteSelf='cascade'"
> ,,,,,,,
> "Photo",,,,,,,
> ,"fileID","string",,1,,50,"isUnique"
> ,"album","Album",,1,,,
>
> Setting is with AccessorStyle : properties
>
> if "a" is an album and "p" a photo, I get different behavior if I do a
> a.addToPhotos(p) or a p.album = a.
> In the first case, p is immediatly added to a.photos but it is not in
> the second case.
> Of course, in both cases, if I reload the objects from the database, I
> can see p in a.photos...
>
> Looks like if a call to p.album is not updating the album's photos list ?...
>
> (using MK 0.9.1)
That's true. Setting the back reference doesn't automatically add the
object to the list. Instead, adding to the list sets the back ref.
I never thought much about it. I have used MK on several projects and
just always add to the list.
I'm also the primary author of MK btw.
-Chuck
|