Suppose you have have your products in a folder Main, scripts in a subfolder Scripts
and object instances in a subfolder Things, i.e. something like this:
Now call a script doit on an object Obj:
If I want to redirect this call, and context is Obj, I do it like this:
url = context.restrictedTraverse('Scripts').absolute_url() + '/' + \
context.absolute_url(relative=1) + '/doit'
The first line creates: http://localhost/Main/Scripts/
the second line Things/Obj/doit
It works but is it good code? Is there a better way to doit?
Maybe the problem is more in the organization of Zope scripts and objects. For now,
I group scripts into Folders directly under Main and things of users of the site in
If a member wants to access some script, I have to include the script Folder into the
path, which leads to more 'complex' code. If I stuff all scripts into Main directly,
subfolders, I don't have to insert the first line, but then I end up with a Main
loaded with scripts. How should one handle this?
Fights between cats and dogs are prohibited by statute in Barber, North
Joost van Lawick
E: [EMAIL PROTECTED]
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -