[Zope] arrgghhh syntactical hell!!

Jacob Singh jacob@prisonbooks.org
Thu, 22 Nov 2001 23:46:10 -0500


I tried restrictedTraverse but I get authentication issues, it requires
a loggin.

-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de] 
Sent: Wednesday, November 21, 2001 5:42 PM
To: Jacob Singh
Cc: zope@zope.org
Subject: Re: [Zope] arrgghhh syntactical hell!!

Jacob Singh writes:
 > I have an SQL query which pulls a record from a database.  One of the
 > fields is called file1.  It contains a path to a file (i.e.
 > media/inline/asdasd.jpeg).  This file is accessible through LocalFS.
 > LocalFS requires a syntax like media['inline']['asdasd.jpg'], so I
wrote
 > a script to convert the Unix style path to something LocalFS can
 > understand.  This works fine.  Here is the code I use in my DTML doc
to
 > render asdasd.jpg:
 > 
 > <dtml-call expr="REQUEST.set('imgpath',makeLocalFSPath(file1))">
 > <dtml-var "_.getitem(imgpath,1)" null="_[media['none.gif']]">
You will not believe how often I have already answered questions like
yours:

    Use "restrictedTraverse"!


Dieter