[Zope] How to put my scripts into a custom folder (Acquisition
problems)
massimo
massimop at users.berlios.de
Sat Oct 2 12:21:36 EDT 2004
Hermann Himmelbauer wrote:
> Hi,
> I am developing a simple Zope/Plone site and want to put custom scripts in a
> seperate folder, e.g. into /custom_scripts
>
> But how can I now calling these scripts without losing the correct context?
>
> If I e.g. want to call the script "/custom_scripts/myscript" from "/folder1" I
> have to write http://mysite/folder1/custom_scripts/myscript". The context of
> the script is then "/custom_scripts" which is bad as it loses the context of
> "folder1".
>
> When I put the python scripts into the root folder, everything works as the
> context of "http://mysite/folder1/myscript" is then "/folder1" which was my
> intention.
>
> I also don't completely understand it: Why is the context of the first example
> not "folder1/custom_scripts/"? Why does the context change to the container
> of the script?
>
> Is there any good solution to this? Or should I really put all my python
> scripts into the root folder?
>
> Best Regards,
> Hermann
>
I did the same and resolved by using context.aq_parent (or
here/aq_parent) and it looks like it's working, but I'm just a zope
newbie so I hope someone else will be so kind to confirm it's ok or
explain why it's wrong...
massimo
More information about the Zope
mailing list