[Zope] Dynamically choosing a ZSQLMethod to run

Jim Sanford jsanford@atinucleus.com
Wed, 5 Jan 2000 22:50:49 -0600


The way I handle it is with

<dtml-if "a==1">
SQL statement
<dtml-elif "a==2">
SQL statement
<dtml-elif ...
<dtml-else>
SQL statement
</dtml-if>

in the ZSQL method.

A ZSQL method is basically a DTML method that can access a database adapter so you can do just about anything you would do in a
regular dtml method
 __________________________________________________________________

              Jim Sanford
      .       Database/Web Engineer
     / \  /   Accelerated Technology, Inc.
    /   /     720 Oak Circle Drive East
   /  /  \    Mobile, AL 36609
  / /     \   Voice: 334-661-5770  fax: 334-661-5788
 /         \  E-Mail: jsanford@atinucleus.com
              Web: http://www.atinucleus.com

 Source Code, No Royalties, Any CPU...It just make sense !
 __________________________________________________________________



----- Original Message -----
From: Michael Wang-Helmke <mhelmke@play.com>
To: <zope@zope.org>
Sent: Wednesday, January 05, 2000 7:56 PM
Subject: [Zope] Dynamically choosing a ZSQLMethod to run


hi all,

I have an application where I have several different SQL queries I want to
do but I want to use the same DTML method to render the output.  I imagine
that I should be able to store a reference to a ZSQLMethod in a variable
like thing and set it to the right query before I call the DTML method.
Otherwise it seems like I need N display functions for the N queries.  How
can I do this?

I have moderate experience in Python and enough experience in Zope to have
built a bug tracking database system entirely in DTML (no external methods
or external python products).

thanks

Michael Wang-Helmke
Play, Incorporated


_______________________________________________
Zope maillist  -  Zope@zope.org
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 )