this is sort of inheritance of data, right? 
the best i've made so far about this is to get (somehow) all the Rs 
each with it's groups, and then do the inheritance (union over the 
path towards root in your case) over the result rows by hand. if u 
find a better way let me know...
traversing a (recursive) tree isn't an easy thing either, unless u 
save it as nonrecursive (keeping extra links etc) in a way or 
another.

On Thursday 28 August 2008 15:11:42 Cecil Westerhof wrote:
> I was just wondering if the folowing possible.
>
> A record has severall groups connected through a N:M relation.
> But it also has a parent. What I would like is that all the groups
> from the parent (and its parent, etc.) also are seen as group for
> the record.
> When the parent has a group added or removed that should then be
> 'visible' at the child.
> Not a very good description I am afraid, so I'll try to give an
> example.
>
> Say I have the groups G1, G2, G3, G4 and G5.
> I have the records R1 and R2. R1 is the parent of R2 and does not
> have a parent itself.
>
> If R1 has the groups G1 and G2 and R2 has the groups G2, G4 and G5,
> then when asking the list of groups of R2 should give, G1, G2, G4
> and G5.
> When quering for records that have group G1, both R1 and R2 should
> be returned.
>
> When adding G3 to R1 the list for R2 should be: G1, G2, G3, G4 and
> G5. When removing G1 from R1 the list for R2 should be: G2, G3, G4
> and G5. When removing G2 from R1 the list for R2 should be: G2, G3,
> G4 and G5. (R2 has itself also group G2.)
>
> Is this possible with sqlalchemy or has this to be done by hand?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to