Traversal is not meant to have pretty urls.

To do such, I would either :
- add a Site Access Rule in the root folder that would rewrite the url from
the "nice" form to the physical location of the script and add the
parameters to the request object. 
- use Apache in front of Zope and some mod_rewrite magic


-----Original Message-----
Sent: 22 June 2005 16:15
To: David Pratt
Subject: Re: [Zope] Traversal question

----- Original Message ----- 
From: "David Pratt" <[EMAIL PROTECTED]>
>I have gone over the zope book to see what I can do about calling a sql 
>with a form and getting three additional parameters in the request and  am 
>wanting this to get better looking urls that calling the parameters 
>directly in the url.  I asked a similar question yesterday but perhaps  it 
>was not clear enough about what asking. It is really a traversal  question 
>and how to string together a sql query with a zpt form that  also requires 
>parameters from the request namespace.
> I can call my zsql method and then my edit form like this:
> /employee_by_id/employee_id/42/employee_edit_form
> or with simple direct traversal on the zsql method:
> /employee_by_id/42/employee_edit_form
> Problem is I need three other parameters in the request for my edit  form 
> to satisfy my sorting so when the edit form returns it is back on  the 
> same batch page
> Parameters passed in traversal go into the request namespace according  to

> the zope book so was hoping for something similar to this which  doesn't 
> work - and I can't see how it could.
> /employee_by_id/employee_id/42/employee_edit_form/start/2/sort/ 
> employee/reverse/0
> The zope book examples are with python scripts so am not sure whether 
> this is possible with a ZPT that also requires parameters from the 
> request  or will I need a script to be called in the path somewhere to 
> pick up the results of the query and then pass parameters to the form - 
> something like:
> /employee_by_id/employee_id/42/some_other_script/start/2/sort/employee/ 
> reverse/0/employee_edit_form
> where some_other_script would be a script python.  Any hints to help me 
> understand what can be done with traversal like this would be  appreciated

> since I would rather have nice urls instead of stringing  parameters 
> directly in the url with all the ?= and &'s.

I am sure you don't want to hear this, but that's what '? = &' are for.  If 
you really want to make your life complicated you could look into storing 
the parameters in cookies or session data, but those are pretty ugly 
work-arounds just so you can have pretty urls.


Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to