Alexandre CONRAD wrote: > Ok, maybe I got influenced by articles about nested sets beeing better, > as pointed Mike. Now I got you guys advices, I'll look deeper into > adjacency list. I'm glad I've had such feedback on my problem. This > defenitly helps, even more when you just don't know from where to start. > > Also these "optimized_al.py" and "adjacency_list.py" examples will help > me building my own SA models for this part of my project.
All these hierarchical possiblities are a lot of information at the same time for me. Althought, I seem to be realizing that I will have another issue: I need to keep track of the playlist's nodes ordering. And it seems that the adjacency list method doesn't allow me to keep track of the ordering. Is this correct ? For now, we have mostly talked about vertical, top/down navigation style. From the XML DOM specs, this would correspond to the "parentNode" (single node), "childNodes" (list of nodes) of the "Node" object. But how about horizontal navigation? Having a childNodes() method to my Node class would return an unorder list of nodes (or ordered by id, which has no logic with the playlist of course). XML DOM refers to methods like "previousSibling", "nextSibling", "firstChild", "lastChild", "insertBefore". From my XML example, I wouldn't want to have "outro.avi" read before "intro.avi", this is primordial: <main> <video>intro.avi</video> ... <video>outro.avi</video> </main> Somehow, I need to have a field that keeps an ordering number for the nodes. Meaning that every create/move/delete action would still need me to update the ordering number of other nodes, like the Nested Set model does. But at least, I could just update the ordering number of the nodes from the same level rather than the whole tree. <main> <video>intro.avi</video> [0] <group> [1] <video>foo.avi</video> [0] <video>bar.avi</video> [1] </group> <group> [2] <video>weather_intro.avi</video> [0] <image>morning.jpg</image> [1] <image>afternoon.jpg</image> [2] <video>brought_to_you_by.avi</video> [3] <media_list> [4] <video>brand_A.avi</video> [0] <video>brand_B.avi</video> [1] <video>brand_C.avi</video> [2] </media_list> </group> <video>outro.avi</video> [3] </main> Any thoughts ? Regards, -- Alexandre CONRAD --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---