Re: Samples for displaying a tree of data

2006-07-16 Thread [EMAIL PROTECTED]
Can you give some more details on how to implement this in django, how to use it with the admin interface? mamcxyz wrote: > I don't think my code is usefull for you... I build the tree from a > list like: > > ['uno\dos\tres','dos\tres\cuatro','pepe\papa\pepa'] > > However the API of elementree e

Re: Samples for displaying a tree of data

2006-07-14 Thread mamcxyz
I don't think my code is usefull for you... I build the tree from a list like: ['uno\dos\tres','dos\tres\cuatro','pepe\papa\pepa'] However the API of elementree es very simple. A good trick is build a map of son and parents. This way: self.parent_map = dict((c, p) for p in tree.getiterator() f

Re: Samples for displaying a tree of data

2006-07-14 Thread Chris Moffitt
> > I like to use elementtree here... The result tree can be cached and in > the end you have a more usefull representation... > Interesting. Do you have any reference code I could look at to try to wrap my brain around it? I haven't had a chance to look at Malcolm's samples yet but I do intend

Re: Samples for displaying a tree of data

2006-07-14 Thread mamcxyz
I like to use elementtree here... The result tree can be cached and in the end you have a more usefull representation... Plus, traslate it to any html tree control become more easy... --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: Samples for displaying a tree of data

2006-07-13 Thread Malcolm Tredinnick
On Thu, 2006-07-13 at 22:03 -0500, Chris Moffitt wrote: > I'm using the recipe here > (http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic) > for a category model. It's working well for the most part. > > I am getting a little stuck trying to figure out how to turn it into a

Samples for displaying a tree of data

2006-07-13 Thread Chris Moffitt
I'm using the recipe here (http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic) for a category model. It's working well for the most part. I am getting a little stuck trying to figure out how to turn it into a vertical navigation structure. I've looked at http://code.djan