I am facing a problem, that might seem trivial in the eyes of a client,
but I found that it's really not straight-forward to implement in
CherryPy. What I am talking about are parameters that should be
available in each URL and should be processed identically everytime.

I brought this up a few days ago in the IRC channel alongside another
problem. A solution to the problem I described there was found.
However, as I badly formulated my problem it still was not able to deal
with the "global URL parameters" problem.

What I am looking for is something like this: The user should be able
to access the following addresses:

http://domain/events/list?skin=default
http://domain/events/show?id=432&skin=myskin
http://domain/events/list
http://domain/?skin=print

So the "skin" parameter should be optional and accessible anywhere. I
could go about and add add this parameter to each method, but that
would be very tedious. And imaging you would want to add another global
parameter after you wrote some code. You then would need to add this
new parameter to each method. This is very error-prone.

Is it not possible to write handler for these parameters in one central
place?

Or is it possible to write a handler for unknown parameters?

I was thinking of adding a "**kwargs" to each method and then call a
function with this dictionary as parameter. It would work, but it would
still be a bit ugly.

Best regards,

Mich.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to