[Zope-CMF] portal skins and containership

Fearless Froggie fearless_froggie@yahoo.com
Wed, 26 Feb 2003 17:31:02 -0800 (PST)


Hi,

Thanks in advance for any bright ideas anybody might
have. If you know of any examples or tutorials that
explain what I'm trying to do below, please point me
to them :) Sorry this is a bit long ...

I was trying out this script in my "custom" skins
directory:

container.objectValues(object_type)

and realized that the "container" for this was
actually the root of the portal itself. 

Is that the point to the "skins"? Anything you run
there will run as if it were running at the root of
your portal? To run the script in your skins directory
in the context of a subfolder of your portal, I guess
you would just create the appropriate URL and add the
script name at the end. 

What if I wanted to run this script in the context of
a subfolder in my portal? This will be running in a
python script stored in a skin (to be specific it'll
be part of a directory based custom CMF type) and the
user won't necessarily be in the subfolder that I'd
like the script to run in the context of. How would I
run this script "objectValues(object_type)" in the
context of that particular directory? The script won't
be in the correct container and the user won't be at
the correct URL.

I tested the following:

my_folder = 'test5' 
my_folder.objectValues(my_object_type)

in a python script and got the following error and
traceback:

Error Type: AttributeError 
Error Value: objectValues 

File
/usr/local/zope/2.5.1/lib/python/Products/PythonScripts/PythonScript.py,
line 302, in _exec
    (Object: test)
    (Info: ({'script': <PythonScript instance at
8ec04e0>, 'context': <CMFCouncilCategory
instance at 95bfdc0>, 'container': <CMFSite
instance at 8ffab40>, 'traverse_subpath': []}, (),
{}, None))
  File Script (Python), line 12, in test
AttributeError: (see above)

Looking at the traceback above, "context =
CMFCouncilCategory instance": CMFCouncilCategory is my
folder type, and I assume the url that I'm running the
script from. "container = CMFSite instance" is the
portal. I'm not sure exactly what the
"traverse_subpath" is.

The script works great with "context" or "container".
I just can't figure out how to point it anywhere else.

Many Thanks, Rita.

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/