1
여러 가지 유형의 데이터를 입력하는 Python 3.5에서 CherryPy를 사용하여 간단한 웹 양식을 만들려고합니다 (sqlite3 데이터베이스와 비교). 확인란을 선택하지 않으면 기본값 null 값이없는 것으로 가정합니다 (예 : 가정). 그것은 "on"이거나 존재하지 않습니다. 빈 상자를 자동으로 '없음'으로 설정하도록 양식을 어떻게 바꿀 수 있습니까?CherryPy 웹 양식 : 선택하지 않은 경우 확인란이 오류가 발생합니다.
는 HTML 체크 박스의 일반 행동의404 Not Found
Missing parameters: training
Traceback (most recent call last):
File "C:\Users\Anna\AppData\Local\Programs\Python\Python35\lib\site-packages\cherrypy\_cpdispatch.py", line 60, in __call__
return self.callable(*self.args, **self.kwargs)
TypeError: search() missing 1 required positional argument: 'training'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Anna\AppData\Local\Programs\Python\Python35\lib\site-packages\cherrypy\_cprequest.py", line 670, in respond
response.body = self.handler()
File "C:\Users\Anna\AppData\Local\Programs\Python\Python35\lib\site-packages\cherrypy\lib\encoding.py", line 221, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "C:\Users\Anna\AppData\Local\Programs\Python\Python35\lib\site-packages\cherrypy\_cpdispatch.py", line 66, in __call__
raise sys.exc_info()[1]
File "C:\Users\Anna\AppData\Local\Programs\Python\Python35\lib\site-packages\cherrypy\_cpdispatch.py", line 64, in __call__
test_callable_spec(self.callable, self.args, self.kwargs)
File "C:\Users\Anna\AppData\Local\Programs\Python\Python35\lib\site-packages\cherrypy\_cpdispatch.py", line 163, in test_callable_spec
raise cherrypy.HTTPError(404, message=message)
cherrypy._cperror.HTTPError: (404, 'Missing parameters: training')
감사합니다. 이전에 성공하지 못했던 메서드 호출에서 'training = None'의 기본 인수를 시도했는데 구문이 잘못되었을 수 있습니다. 두 번째 솔루션을 사용하고 치료를했습니다. – fianchi04