[Zope-PTK] ZTopics question: creating a hierarchy

Kevin Dangoor kid@kendermedia.com
Wed, 12 Apr 2000 09:37:48 -0400


Hi,

    Let's say you want to create a hierarchy of links like Yahoo! or dmoz.
For example, if you have the following categories:

Recreation:Humor:Parody:News
Entertainment:Humor:Weird Al Yankovic

How would you actually set up your ZTopics to display these hierarchies? If
you want an arbitrarily deep hierarchy, It's not as simple as having a
category and subcategory field. One possibility that comes to my mind is
have a "parent category" pointer and then the category name.

parent: None
name: Recreation

parent: /path/to/recreation
name: Humor

parent: /path/to/rechumor
name: Parody

Then, you can easily work your way down (or up) the tree. In fact, it
actually seems like it would be easier to just build your link list in a
folder hierarchy in the ZODB rather than doing it this way. But then, you
couldn't have members with Link objects in their own Folders.

Is there some obvious way to do an arbitrary hierarchy with ZTopics that I'm
missing?

Kevin
http://www.byproducts.com - Humor and Novelties