Re: [Zope] Re: dtml-tree with data from multiple tables
Hi Lance, Lance Kurisaki wrote: I'd like to generate a tree with data from different SQL tables depending on the tree level. In other words, the first level data comes from one table, second level comes from another. How can the branches_expr expression determine what the current tree level is? Can I pass a parameter to let me know the current level? I tried the following, but it didn't work... dtml-tree id=name branches_expr="child_lookup(_['tree-level'])" I think Anthony baxter's "Some neat tricks with dtml-tree" url: http://www.zope.org/Members/anthony/tree-coding-tricks will help you out That How-To uses the same SQL table to define children at all levels of the tree. How can I use different tables at different levels? Am I able to determine the current level in my child_lookup() method? I used a trick to archive this: each of my tables has a number as key. dtml-tree needs a unique id for lookup. So to make it unique, I add an offset to each tables key and remove it for query. My query is kind of self modifying for this, comparing if the key is inside a given interval and making the query at the appropriate table with removing the offset first and adding the next offset to the results. I can provide an example, if you wish. Regards Tino Wildenhain ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Re: dtml-tree with data from multiple tables
Thanks for the hint! A small example would be nice, if it's not too much trouble! Lance -Original Message- From: Tino Wildenhain [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 10, 2000 2:26 AM To: Lance Kurisaki Cc: [EMAIL PROTECTED] Subject: Re: [Zope] Re: dtml-tree with data from multiple tables Hi Lance, Lance Kurisaki wrote: I'd like to generate a tree with data from different SQL tables depending on the tree level. In other words, the first level data comes from one table, second level comes from another. How can the branches_expr expression determine what the current tree level is? Can I pass a parameter to let me know the current level? I tried the following, but it didn't work... dtml-tree id=name branches_expr="child_lookup(_['tree-level'])" I think Anthony baxter's "Some neat tricks with dtml-tree" url: http://www.zope.org/Members/anthony/tree-coding-tricks will help you out That How-To uses the same SQL table to define children at all levels of the tree. How can I use different tables at different levels? Am I able to determine the current level in my child_lookup() method? I used a trick to archive this: each of my tables has a number as key. dtml-tree needs a unique id for lookup. So to make it unique, I add an offset to each tables key and remove it for query. My query is kind of self modifying for this, comparing if the key is inside a given interval and making the query at the appropriate table with removing the offset first and adding the next offset to the results. I can provide an example, if you wish. Regards Tino Wildenhain __ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: dtml-tree with data from multiple tables
I'd like to generate a tree with data from different SQL tables depending on the tree level. In other words, the first level data comes from one table, second level comes from another. How can the branches_expr expression determine what the current tree level is? Can I pass a parameter to let me know the current level? I tried the following, but it didn't work... dtml-tree id=name branches_expr="child_lookup(_['tree-level'])" I think Anthony baxter's "Some neat tricks with dtml-tree" url: http://www.zope.org/Members/anthony/tree-coding-tricks will help you out That How-To uses the same SQL table to define children at all levels of the tree. How can I use different tables at different levels? Am I able to determine the current level in my child_lookup() method? Thanks, Lance __ Do You Yahoo!? Yahoo! Photos -- now, 100 FREE prints! http://photos.yahoo.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )