Пример #1
0
 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)
Пример #2
0
 def GET(self):
     return render.setup(dao.numbers_count())