[Zope] Images and database

Christoph Schirmer Christoph.Schirmer@snafu.de
Tue, 24 Jul 2001 08:42:41 +0200


This is a multi-part message in MIME format.
--------------AB38B219C35B1F0D0108AC0F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am using a mysql database. Actually the sql queries with zsql are by
far the easiest part in learning Zope :-)
Anyway, I have the following problem. Some of the data also need to be
associated with pictures. E.g. for countries, there
are flags. Where should one at best store the flags? I thought it
could be better to store them within Zope, so that they files can be
used easily outside the database as well.
In the site root I created a folder images, and as id I used the short
tag of the country (e.g. ITA for Italy), which can be
found in the field cou_tag.
The method looks like this:
<tr><th>Country-ID</th><th>Tag</th><th>Country</th><th><a
href="listbycontinent">Continent</th><th>&nbsp;></tr>

<dtml-in countries>
<tr><td><dtml-var cou_id></td><td><dtml-var cou_tag></td><td><dtml-var
cou_name></td><td><dtml-var con_name></td><td><img
src="&dtml-portal_url;/images/<dtml-var cou_tag>" ALT="<dtml-var
cou_name>" align="absmiddle"></td></tr>

</dtml-in>
</table>

It is probably rude, but I am a newbie :-). And it works, basically, but
it is awfully slow, because for each entry it
searches the images folder for a file.

Is there a way to make this more elegant, and faster?

Thanks for your help,
Christoph



--------------AB38B219C35B1F0D0108AC0F
Content-Type: text/x-vcard; charset=us-ascii;
 name="Christoph.Schirmer.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Christoph Schirmer
Content-Disposition: attachment;
 filename="Christoph.Schirmer.vcf"

begin:vcard 
n:Schirmer;Christoph
x-mozilla-html:TRUE
url:http://www.MastersofGPL.org
adr:;;;;;;
version:2.1
email;internet:Christoph.Schirmer@snafu.de
x-mozilla-cpt:;-26944
fn:Christoph Schirmer
end:vcard

--------------AB38B219C35B1F0D0108AC0F--