comparison data/plugin/action/submitcsv.py @ 626:f64779d5d500

FormSubmit: simplify code, auto-provide filename
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Mar 2013 18:29:47 +0100
parents f4e63b74b969
children f683dea1ac1b
comparison
equal deleted inserted replaced
625:f4e63b74b969 626:f64779d5d500
30 30
31 def __init__(self, pagename, request): 31 def __init__(self, pagename, request):
32 SubmitBase.__init__(self, pagename, request) 32 SubmitBase.__init__(self, pagename, request)
33 33
34 self.delimiter = ';' 34 self.delimiter = ';'
35 self.targetFile = "" 35 self.targetFile = request.form.get("targetfile", "list.csv")
36 36
37 if "targetfile" in request.form:
38 self.targetFile = request.form.get("targetfile")
39 else:
40 self.targetFile = u"list.csv"
41
42 def sanitize(self): 37 def sanitize(self):
43 SubmitBase.sanitize(self) 38 SubmitBase.sanitize(self)
44 self.targetFile = wikiutil.clean_input(self.targetFile) 39 self.targetFile = wikiutil.clean_input(self.targetFile)
45 40
46 def submit(self): 41 def submit(self):