On Jan 1, 2011, at 12:38 AM, Arun K.Rajeevan wrote:
> My application has a search form: it self submit to whatever page it is in 
> and redirects to search function.
> I took vars from search form (like, term = request.args(0)) and redirect as 
> redirect (c='..', f='..', args=[v])
> 
> Now, in result of search form I get underscores(_) if search term include a 
> space.
> (eg.,'top parts' displayed as 'top_parts') I want the space to retain
> 
> also if term contains a apostrophe I get invalid request page. (eg., I'm ) 
> 
> Former one can be overcome by manually replacing underscore with space.
> But what to do about later one?

I'll be addressing this in the new URL rewriting mechanism. In the meantime, 
have a look at the raw_args option in routes.py:

# specify a list of apps that bypass args-checking and use request.raw_args
#
#routes_apps_raw=['myapp']
#routes_apps_raw=['myapp', 'myotherapp']

This is a hack to work around the problem. If you list your app in this routing 
variable, request.args will be set to None, and the (mostly) unprocessed args 
will appear as a string in request.raw_args. You'll need to split them yourself 
and do whatever processing you need.

Alternatively, experiment with using the query string (vars) instead of args.

Reply via email to