[Zope] DTML parameter to Python script

Michael Bleijerveld michael at bleijerveld.nl
Fri Oct 3 06:23:10 EDT 2003


Hi Dylan,

When one of the links is pressed I need the  name of the selected link
(directoryname) for displaying the files in this directory.

Example:
- Documents
- Pictures
- Movies

How can I use a Python script to set the current directory ?

Regards.

Michael


----- Original Message ----- 
From: "Dylan Reinhardt" <zope at dylanreinhardt.com>
To: "Zope Users" <zope at zope.org>
Sent: Thursday, October 02, 2003 11:15 PM
Subject: Re: [Zope] DTML parameter to Python script


> On Thu, 2003-10-02 at 12:03, Michael Bleijerveld wrote:
> <snip>
> > url=context.REQUEST.URL1 + '/' + 'test'
> > return url
>
> Here's the problem.
>
> Even though this code is called several times in one request, the URL1
> property of REQUEST isn't going to change at any point during the
> request.  That explains why every time through your loop, you're getting
> the same result.
>
> It's not clear what you *mean* to have happen in this script... the only
> line that seems to do anything is this one:
>
> > container.REQUEST.set('CurrentDir',directory)
>
> Which only re-names the "directory" variable, which I assume was a
> parameter to the script.  It's not clear what purpose this could serve.
>
> Perhaps you meant for the generated URL to have something to do with the
> current user and the directory name passed in.  That might be:
>
> url = '/'.join([context.REQUEST.URL1,username,directory])
>
> Or something like that.  If that doesn't help, maybe you could describe
> what the script is *supposed* to return.
>
> HTH,
>
> Dylan
>
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>





More information about the Zope mailing list