def POST(self): form = web.input(_unicode=True, numbers={}) error = None web.debug(form) if 'numbers' in form: errors = dao.load_numbers(csv.reader(form.numbers.file)) if errors > 0: error = 'Error in %d lines.' % errors else: error = 'No file uploaded' msg = None if error else ('Successfully uploaded %s.' % form.numbers.filename) return render.setup(dao.numbers_count(), msg, error)
def GET(self): return render.setup(dao.numbers_count())