Hi all, i've found a solution to the problem of too-long-url.
i hope this is useful
Paginate function (next_page, top_page, end_page, next_page) create url
based on how many field are in the form, using
all data from request.
cherrypy.request.params.copy()
if a form has a lot of field this create an invalid URL, so i have
create a work-around for this.
before passing data to variable_encode i clear unuseful data from
request with a simple recursive funct.
this is the patch i've made of paginate.py
164,176c164
<
< # clear unuseful data
< def clear_empty_value( d ):
< if isinstance(d, dict):
< return dict( [( k,clear_empty_value(v) ) for k,v
in d.items() if v])
< elif isinstance(d, list):
< return [ clear_empty_value(v) for v in d]
< else:
< return d
< input_values = variable_encode(clear_empty_value(
cherrypy.request.params ) )
< # FIXED # input_values =
variable_encode(cherrypy.request.params.copy())
<
<
---
> input_values =
variable_encode(cherrypy.request.params.copy())
can this become a patch to paginate for next release?
Glauco
--
+------------------------------------------------------------+
Glauco Uri
glauco(at)sferacarta.com
Sfera Carta Software® info(at)sferacarta.com
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---