[Zope] Tree Tag & SQL

Kent Polk kent@goathill.org
12 Mar 1999 22:04:17 GMT


On 12 Mar 1999 05:55:00 -0600, ron@rotflol.cx <ron@rotflol.cx> wrote:
>I am trying to implemented a directory service using the tree tag where the 
>info from several tables of a database.
>
>A simplified outline:
>
>+Locations
> +Offices
>  +People
>   +Phones
>     Tel
>     Fax
>   +Addresses
>
>Problem: how to have the tree tag use a different SQL method for each level 
>WITHOUT resorting to external methods, because the directory should be 
>maintainable by mere mortals, not Python or SQL gods.

Brian built a pretty cool way to hook SQL entries to particular
folder trees for the PDMS.  Each folder has a uniqueid which is
stored in a sql table, along with the folder parent heirarchy, when
an item is added to the SQL database.  This allows each folder to
easily identify which SQL entries belong directly to it and which
SQL entries belong as children.  This allows one to easily do things
such as count the number of SQL items which are identified with a
folder tree using SQL query syntax.

Brian also provided dtml methods to move folders and their
relationships around in the Zope heirarchy quite nicely. The
mechanism holds quite a few SQL items in it and there has never
been a need for a Python or SQL god to do any maintenance on the
system at that level.

However, it does use both SQL and External Methods. So, don't
believe that just because something requires a fairly deep level
of competence to create that it requires that same level of competence
to maintain (me for example :^).  That's simply one mark of a decent
implementation.

Kent