[Zope] Re: Python script returning link to local file

Derrick 'dman' Hudson dman at dman13.dyndns.org
Tue Aug 12 17:56:27 EDT 2003


On Tue, Aug 12, 2003 at 07:22:54PM +0200, Michael Bleijerveld wrote:
| Hi,
| 
| I want to use a Python script for returning a link to a local file (in a
| LocalFS object) in ZPT.
| The parameter given is the id of the file and is named file.
| 
| from AccessControl import getSecurityManager
| user = getSecurityManager().getUser()
| username = user.getUserName()
| 
| return container[username].[file]
                            ^^

| This doesn't work. Is it a reference problem ?

The above is a syntax error.  You probably meant to write

    return container[username][file]

(no '.'), but I can't say for certain because I don't have experience
with LocalFS.

-D

-- 
Do not be afraid of those who kill the body but cannot kill the soul.
Rather be afraid of the One who can destroy both soul and body in hell.
        Matthew 10:28
 
http://dman13.dyndns.org/~dman/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : http://lists.zope.org/pipermail/zope/attachments/20030812/9bfb3f9f/attachment.bin


More information about the Zope mailing list