[Zope] Creating a List from a SQLMethod

Martijn Pieters mj@digicool.com
Tue, 4 Jan 2000 09:07:10 -0500


> If you have cacheing turned on for the query (cache 
> persistence time > time for zope to render page), zope should 
> pull the select
> items from the cache and not actually rerun the query on the 
> database server. Therefore, the time saved by creating a list to reuse
> is probably negligible.
> 
> Also, the way you are doing it results in the list of select 
> items being sent in html multiple times, if the select is a long one
> this will noticebly slow down the loading speed on the 
> browser for those with slow connections. An alternative would 
> be to create a
> javascript array once and use a javascript function to create 
> the select lists on the browser to your hearts content.


Hmm.. I believe that dtml-in, like dtml-var, within one DTML
method/document, caches retrieved names. So on call to dtml-in
SQL_Method_x will actually call it, and a next reference within a DTML
method will use a cached copy of that call.

I have not checked this though, this is a little excercise left for you
guys.

-- 
Martijn Pieters, Software Engineer 
| Digital Creations http://www.digicool.com 
| Creators of Zope      http://www.zope.org 
| mailto:mj@digicool.com       ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 
-------------------------------------------