def dosomething(self, a, b, submit = None):

0 views
Skip to first unread message

illume

unread,
Jun 23, 2009, 7:31:19 PM6/23/09
to cherrypy-users
Hello,

does anyone know how to get rid of the submit=None part?

def dosomething(self, a, b, submit = None):

Since I want forms to pass through a submit field, but for the
cherrypy side to ignore it.


It would be good if I could enable this for a whole application, so no
more 'submit=None' in its methods.

Any ideas on how to get around this?


cheers,

fumanchu

unread,
Jun 23, 2009, 8:52:39 PM6/23/09
to cherrypy-users
def pop_params(params):
for p in params:
cherrypy.request.params.pop(p, None)
cherrypy.tools.pop_params = cherrypy.Tool('before_handler',
pop_params)


[/]
tools.pop_params.on = True
tools.pop_params.params = ['submit']


Robert Brewer
fuma...@aminus.org

Sylvain Hellegouarch

unread,
Jun 24, 2009, 2:13:28 AM6/24/09
to cherryp...@googlegroups.com
fumanchu a écrit :

Isn't CherryPy cool? :)

- Sylvain

illume

unread,
Jun 25, 2009, 2:54:31 AM6/25/09
to cherrypy-users
awesome :) thanks.
> fuman...@aminus.org
Reply all
Reply to author
Forward
0 new messages