Hi Friends, I'm using traversal/zodb for my pyramid application. However I'm a bit confused whether I'm using traversal/resource/tree structure properly or not. The thing which is confusing me the most is the parent concept in tree, where we have to define parents for our resources while creating them.
For explanation I'm trying to present a small problem and will like to know what should be the correct approach for this kind of situation: Suppose we have a college class management system. There are two classes class A and class B, a student 'XYZ' can be a part of one class or both the classes. How I would design it is like this : We have root as college and under root we have a container called classes and a container called students. So when student XYZ is created in system it is added in a container called students, and when he was admitted for class A, he was also added to a container(for students in that class) inside class A resource. Both the objects are the same (students/XYZ is classes/classA/itsStudents/XYZ ) In this case I can't have a parent in student instance when it is created, so I will use pyramid_traversalwrapper which will allow to assign parent dynamically based on the request. If url is students/XYZ , locationproxy will have parent as students and if .../classA/itsstudents/xyz then it will be according to it. My question here is that whether my approach and application/usage of traversal is correct here or will it be done differently from experienced pyramid traversal developers. My doubt stems from very little discussion of traversal wrapper in docs and IRC/forums and this problem seemed to me very common scenario. Metaphor of traversal as file system will also tell that a file can be in two folders ( and I will believe the files will be 'same' not 'similar' - meaning the same object ). Please clear my doubts. Thanks, Anurag -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
