[Zope] Help with drill down SQL queries

Garry Steedman gs@styrax.com
Fri, 22 Jun 2001 15:02:39 +0000


Mark,

this is easy to do using the URL traversal techniques described in 
the Relational Database Connectivity chapter of the Zope Book.

in a nutshell, you need to have a unique Customer Number to use URL 
traversal to link to a view method for Customer Number e.g.

<a href="get_customer_number/<dtml-var 
customer_number>/view_customer_number">Customer Number</a>

inside this method you can arbitrarily add other queries which get 
your work done...

contact me off list if you want more concrete examples...

cheers,

Garry

On 22 Jun 2001, at 7:44, Mark Langkau wrote:

From:           	Mark Langkau <mlangkau@execpc.com>
Send reply to:  	mark.langkau@pbmplus.com
To:             	zope@zope.org
Subject:        	[Zope] Help with drill down SQL queries
Date sent:      	Fri, 22 Jun 2001 07:44:45 -0500

> Hi,
> 
> Rather than reinvent the wheel, I'll ask here to see if anyone has
> done this before.
> 
> I'd like to have an SQL query return data that I will display in a
> table format. Lets say this will include columns such as Customer
> Number, Order Number, Part Number, etc.  I would like to add "drill
> down" capabilities to this by having each cell in a column be a link
> to another query/result table that uses the cell contents as a
> parameter for the query. For example, if the Customer column displays
> each customer number as a link, I could get a page showing all orders
> placed by this customer by clicking on that customer's link in this
> table.
> 
> I would like the solution to be generalized so a developer/designer
> can indicate which columns in the result should have "links" turned
> on. For example, if I click on the Customer Number link in this table,
> I get a page with another table listing customer order numbers, dates,
> totals, etc. and the Order Number column in that table has "links"
> turned on so I can click an order number link and get another table
> showing complete details for that order. ( And then click on a Part
> Number, to get details of the product ...)
> 
> This sounds simple. Format the contents of the column as a link and
> call another predefined query object with the cell contents as a
> parameter. But, I haven't really worked with SQL queries in Zope and
> I'm not sure where to start. I have successfully installed the
> DCOracle2 product (and similar MySQL) and have the test queries
> working. I am also reading the Relational Database chapter of the Zope
> Book.
> 
> Oracle's WebDB product does this, and we are looking to work
> completely within Zope as much as possible. We will be querying Oracle
> 8 databases mostly, but will also like to use this with MySQL (and
> PostgreSQL).
> 
> Cheers,
> Mark
> 
> 
> _______________________________________________
> 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 )


+-------------------------------------------+
  Garry Steedman      mailto:gs@styrax.com  
  Styrax Associates  http://www.styrax.com/ 

  "The Good Man has no shape."            
+-------------------------------------------+