[Zope-dev] Name space in a Script (python)
Casey Duncan
casey_duncan@yahoo.com
Wed, 6 Jun 2001 18:23:07 -0700 (PDT)
--- Jeff <jeff@thecolemans.ws> wrote:
> Hi all,
> I'm trying to get variables from the name space in a
> python script without much luck...
> I think I am missing something very simple, but
> after hours of searching I'm at wits end.
>
> This is what I am trying:
> A DTML document has several properties defined on
> it.
> It calls a python script that needs to access these
> properties.
>
> No matter what I try, I can not get the properties
> from the calling DTML document in the python
> script...
> What am I missing?
>
> Thanks,
> Jeff
>
This will depend on how the Python script is called,
my recommendation would be to call the script in the
context of the DTML document like in the URL:
http://myserver/DTMLDoc/pyScript
Then the DTML Document would be accessed through
"context" as in:
context.title
Otherwise, you would have to access it by traversing
the attributes of it's parent folders as in:
doc = context.folder.subfolder.DTMLDoc
doc.title
hth,
=====
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`----------------->
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/