Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add possibility to change path and method of submit target

  • Loading branch information...
commit e479fecb82cc5cba3ee5968f8c5bab9030dc2eb3 1 parent 3a8663e
@jarus authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 flask_fillin/wrapper.py
View
9 flask_fillin/wrapper.py
@@ -41,13 +41,16 @@ def forms(self):
if self._parsed_html is None:
self._parsed_html = document_fromstring(self.data)
- def _submit(self, client, **kargs):
+ def _submit(self, client, path=None, **kargs):
data = dict(self.form_values())
if kargs.has_key('data'):
data.update(kargs['data'])
del kargs['data']
- return client.open(self.action, method=self.method, data=data,
- **kargs)
+ if path is None:
+ path = self.action
+ if not kargs.has_key('method'):
+ kargs['method'] = self.method
+ return client.open(path, data=data, **kargs)
for form in self._parsed_html.forms:
setattr(form, "submit", types.MethodType(_submit, form))
Please sign in to comment.
Something went wrong with that request. Please try again.