> So I have a tree in my database. My question is that, how can I > represent it on the web as a tree. Something like this :
> > Is there any example that I could study? > I used the category model here - http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic Then, used ElemenTree to create a nested list of the entries. I would end up with something like this - <ul> <li> Books <ul> <li> Fiction</li> <li> Non-fiction</li> </ul> </li> </ul> Once you get this data structure, you can use css, dhtml and javascript to create some sort of dynamic hierarchy. You can find the actual category code in svn here - http://satchmo.python-hosting.com/file/trunk/satchmo/product/models.py The template tag that creates the tree is here - http://satchmo.python-hosting.com/file/trunk/satchmo/shop/templatetags/category_display.py I hope this helps, Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---