ValueError at /vote/add/
invalid literal for int() with base 10: 'AA' Request Method: POST Request URL: http://localhost:8000/vote/add/ Exception Type: ValueError Exception Value: invalid literal for int() with base 10: 'AA' Exception Location: /usr/lib/python2.5/site-packages/django/db/models/ fields/__init__.py in get_db_prep_value, line 353 Python Executable: /usr/bin/python Python Version: 2.5.2 Python Path: ['/home/chris/workspace/veryvote', '/usr/lib/ python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/ local/lib/python2.5/site-packages', '/usr/lib/python2.5/site- packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/ python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/ gst-0.10', '/var/lib/python-support/python2.5', '/usr/lib/python2.5/ site-packages/gtk-2.0', '/var/lib/python-support/python2.5/gtk-2.0', '/ usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode'] Server time: 星期二, 9 十二月 2008 20:53:18 +0800 Traceback Switch to copy-and-paste view * /usr/lib/python2.5/site-packages/django/core/handlers/base.py in get_response 79. # Apply view middleware 80. for middleware_method in self._view_middleware: 81. response = middleware_method(request, callback, callback_args, callback_kwargs) 82. if response: 83. return response 84. 85. try: 86. response = callback(request, *callback_args, **callback_kwargs) ... 87. except Exception, e: 88. # If the view raised an exception, run it through exception 89. # middleware, and if the exception middleware returns a 90. # response, use that. Otherwise, reraise the exception. 91. for middleware_method in self._exception_middleware: 92. response = middleware_method(request, e) ▶ Local vars Variable Value callback <django.contrib.auth.decorators._CheckLogin object at 0x87c1dac> callback_args () callback_kwargs {'template': 'vote/add.html'} e ValueError("invalid literal for int() with base 10: 'AA'",) exc_info (<type 'exceptions.ValueError'>, ValueError("invalid literal for int() with base 10: 'AA'",), <traceback object at 0x8810edc>) exceptions <module 'django.core.exceptions' from '/usr/lib/python2.5/site- packages/django/core/exceptions.pyc'> middleware_method <bound method XViewMiddleware.process_view of <django.middleware.doc.XViewMiddleware object at 0x87442ec>> receivers [(<function _rollback_on_exception at 0x847c144>, None)] request <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {u'description': [u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c'], u'end_date': [u'2008-12-29'], u'title': [u'\u4f60\u662f\u5426\u559c \u6b22\u5531\u6b4c'], u'vote_choices4': [u''], u'vote_choices5': [u''], u'vote_choices2': [u'\u4e0d\u559c\u6b22'], u'vote_choices3': [u''], u'vote_choices1': [u'\u559c\u6b22'], u'tag': [u'\u7231\u597d']} >, COOKIES:{'sessionid': 'e5e21e8250914db63f93569c0bdb282c'}, META: {'CLASSPATH': '.:/usr/lib/jvm/java-6-sun/lib', 'COLORTERM': 'gnome- terminal', 'CONTENT_LENGTH': '308', 'CONTENT_TYPE': 'application/x-www- form-urlencoded', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus- BPEscXYXhI,guid=c67f4dd4a61cf9ff8b84e559493dedc5', 'DESKTOP_SESSION': 'default', 'DESKTOP_STARTUP_ID': '', 'DISPLAY': ':0.0', 'DJANGO_SETTINGS_MODULE': 'veryvote.settings', 'GATEWAY_INTERFACE': 'CGI/1.1', 'GDMSESSION': 'default', 'GDM_LANG': 'zh_CN.UTF-8', 'GDM_XSERVER_LOCATION': 'local', 'GNOME_DESKTOP_SESSION_ID': 'Default', 'GNOME_KEYRING_PID': '6157', 'GNOME_KEYRING_SOCKET': '/tmp/ keyring-v5G1n2/socket', 'GPG_AGENT_INFO': '/tmp/seahorse-EcHJt8/S.gpg- agent:6219:1', 'GTK_IM_MODULE': 'scim-bridge', 'GTK_RC_FILES': '/etc/ gtk/gtkrc:/home/chris/.gtkrc-1.2-gnome2', 'HISTCONTROL': 'ignoreboth', 'HOME': '/home/chris', 'HTTP_ACCEPT': 'text/html,application/xhtml +xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max- age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=e5e21e8250914db63f93569c0bdb282c', 'HTTP_HOST': 'localhost: 8000', 'HTTP_KEEP_ALIVE': '300', 'HTTP_REFERER': 'http://localhost: 8000/vote/add/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.0.4) Gecko/2008111317 Ubuntu/8.04 (hardy) Firefox/ 3.0.4', 'JAVA_HOME': '/usr/lib/jvm/java-6-sun', 'LANG': 'zh_CN.UTF-8', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LESSOPEN': '| /usr/bin/ lesspipe %s', 'LOGNAME': 'chris', 'LS_COLORS': 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*. 7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:', 'OLDPWD': '/home/chris', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/ sbin:/usr/bin:/sbin:/bin:/usr/games', 'PATH_INFO': u'/vote/add/', 'PWD': '/home/chris/workspace/veryvote', 'QT_IM_MODULE': 'xim', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_HOST': '', 'REQUEST_METHOD': 'POST', 'RUN_MAIN': 'true', 'SCRIPT_NAME': u'', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.5.2', 'SESSION_MANAGER': 'local/chris-Legend:/tmp/.ICE-unix/6162', 'SHELL': '/bin/bash', 'SHLVL': '1', 'SSH_AUTH_SOCK': '/tmp/keyring-v5G1n2/ssh', 'TERM': 'xterm', 'TZ': 'Asia/Shanghai', 'USER': 'chris', 'USERNAME': 'chris', 'WINDOWID': '65011804', 'WINDOWPATH': '7', 'XAUTHORITY': '/ home/chris/.Xauthority', 'XDG_DATA_DIRS': '/usr/local/share/:/usr/ share/:/usr/share/gdm/', 'XDG_SESSION_COOKIE': 'd4eca9b1c5cb470d46b4e19148d5093c-1228795330.953588-382266091', 'XMODIFIERS': '@im=SCIM', '_': '/usr/bin/python', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0xb7dd60b0>, 'wsgi.file_wrapper': <class 'django.core.servers.basehttp.FileWrapper'>, 'wsgi.input': <socket._fileobject object at 0x873bed4>, 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> resolver <RegexURLResolver veryvote.urls ^/> response None self <django.core.handlers.wsgi.WSGIHandler object at 0x85eb6ac> settings <django.conf.LazySettings object at 0xb7d28d6c> urlconf 'veryvote.urls' urlresolvers <module 'django.core.urlresolvers' from '/usr/lib/python2.5/site- packages/django/core/urlresolvers.pyc'> * /usr/lib/python2.5/site-packages/django/contrib/auth/ decorators.py in __call__ 60. 61. def __get__(self, obj, cls=None): 62. view_func = self.view_func.__get__(obj, cls) 63. return _CheckLogin(view_func, self.test_func, self.login_url, self.redirect_field_name) 64. 65. def __call__(self, request, *args, **kwargs): 66. if self.test_func(request.user): 67. return self.view_func(request, *args, **kwargs) ... 68. path = urlquote(request.get_full_path()) 69. tup = self.login_url, self.redirect_field_name, path 70. return HttpResponseRedirect('%s?%s=%s' % tup) ▶ Local vars Variable Value args () kwargs {'template': 'vote/add.html'} request <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {u'description': [u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c'], u'end_date': [u'2008-12-29'], u'title': [u'\u4f60\u662f\u5426\u559c \u6b22\u5531\u6b4c'], u'vote_choices4': [u''], u'vote_choices5': [u''], u'vote_choices2': [u'\u4e0d\u559c\u6b22'], u'vote_choices3': [u''], u'vote_choices1': [u'\u559c\u6b22'], u'tag': [u'\u7231\u597d']} >, COOKIES:{'sessionid': 'e5e21e8250914db63f93569c0bdb282c'}, META: {'CLASSPATH': '.:/usr/lib/jvm/java-6-sun/lib', 'COLORTERM': 'gnome- terminal', 'CONTENT_LENGTH': '308', 'CONTENT_TYPE': 'application/x-www- form-urlencoded', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus- BPEscXYXhI,guid=c67f4dd4a61cf9ff8b84e559493dedc5', 'DESKTOP_SESSION': 'default', 'DESKTOP_STARTUP_ID': '', 'DISPLAY': ':0.0', 'DJANGO_SETTINGS_MODULE': 'veryvote.settings', 'GATEWAY_INTERFACE': 'CGI/1.1', 'GDMSESSION': 'default', 'GDM_LANG': 'zh_CN.UTF-8', 'GDM_XSERVER_LOCATION': 'local', 'GNOME_DESKTOP_SESSION_ID': 'Default', 'GNOME_KEYRING_PID': '6157', 'GNOME_KEYRING_SOCKET': '/tmp/ keyring-v5G1n2/socket', 'GPG_AGENT_INFO': '/tmp/seahorse-EcHJt8/S.gpg- agent:6219:1', 'GTK_IM_MODULE': 'scim-bridge', 'GTK_RC_FILES': '/etc/ gtk/gtkrc:/home/chris/.gtkrc-1.2-gnome2', 'HISTCONTROL': 'ignoreboth', 'HOME': '/home/chris', 'HTTP_ACCEPT': 'text/html,application/xhtml +xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max- age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=e5e21e8250914db63f93569c0bdb282c', 'HTTP_HOST': 'localhost: 8000', 'HTTP_KEEP_ALIVE': '300', 'HTTP_REFERER': 'http://localhost: 8000/vote/add/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.0.4) Gecko/2008111317 Ubuntu/8.04 (hardy) Firefox/ 3.0.4', 'JAVA_HOME': '/usr/lib/jvm/java-6-sun', 'LANG': 'zh_CN.UTF-8', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LESSOPEN': '| /usr/bin/ lesspipe %s', 'LOGNAME': 'chris', 'LS_COLORS': 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*. 7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:', 'OLDPWD': '/home/chris', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/ sbin:/usr/bin:/sbin:/bin:/usr/games', 'PATH_INFO': u'/vote/add/', 'PWD': '/home/chris/workspace/veryvote', 'QT_IM_MODULE': 'xim', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_HOST': '', 'REQUEST_METHOD': 'POST', 'RUN_MAIN': 'true', 'SCRIPT_NAME': u'', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.5.2', 'SESSION_MANAGER': 'local/chris-Legend:/tmp/.ICE-unix/6162', 'SHELL': '/bin/bash', 'SHLVL': '1', 'SSH_AUTH_SOCK': '/tmp/keyring-v5G1n2/ssh', 'TERM': 'xterm', 'TZ': 'Asia/Shanghai', 'USER': 'chris', 'USERNAME': 'chris', 'WINDOWID': '65011804', 'WINDOWPATH': '7', 'XAUTHORITY': '/ home/chris/.Xauthority', 'XDG_DATA_DIRS': '/usr/local/share/:/usr/ share/:/usr/share/gdm/', 'XDG_SESSION_COOKIE': 'd4eca9b1c5cb470d46b4e19148d5093c-1228795330.953588-382266091', 'XMODIFIERS': '@im=SCIM', '_': '/usr/bin/python', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0xb7dd60b0>, 'wsgi.file_wrapper': <class 'django.core.servers.basehttp.FileWrapper'>, 'wsgi.input': <socket._fileobject object at 0x873bed4>, 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> self <django.contrib.auth.decorators._CheckLogin object at 0x87c1dac> * /home/chris/workspace/veryvote/vote/views.py in addvote 37. clubchoosen = Club.objects.get(club_name = clubchoose) 38. else: 39. clubchoosen = None 40. tag = form.cleaned_data.get('tag') 41. 42. vote = Vote.objects.create(title = title,author = request.user, description = description, end_date = enddate, 43. new_choice_able = newchoice, anonymous_able = anonymous, 44. club_only = clubonly, pub_date = datetime.datetime.now (),tag = tag,club_choose = clubchoosen) ... 45. if len(tag) > 0: 46. if ' ' in tag: 47. taglist = tag.split(" ") 48. else: 49. taglist = [] 50. taglist = taglist.append(tag) ▶ Local vars Variable Value anonymous False clubchoose None clubchoosen None clubonly False description u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c' enddate datetime.datetime(2008, 12, 29, 0, 0) form <vote.forms.VoteForm object at 0x87c89cc> newchoice False request <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {u'description': [u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c'], u'end_date': [u'2008-12-29'], u'title': [u'\u4f60\u662f\u5426\u559c \u6b22\u5531\u6b4c'], u'vote_choices4': [u''], u'vote_choices5': [u''], u'vote_choices2': [u'\u4e0d\u559c\u6b22'], u'vote_choices3': [u''], u'vote_choices1': [u'\u559c\u6b22'], u'tag': [u'\u7231\u597d']} >, COOKIES:{'sessionid': 'e5e21e8250914db63f93569c0bdb282c'}, META: {'CLASSPATH': '.:/usr/lib/jvm/java-6-sun/lib', 'COLORTERM': 'gnome- terminal', 'CONTENT_LENGTH': '308', 'CONTENT_TYPE': 'application/x-www- form-urlencoded', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus- BPEscXYXhI,guid=c67f4dd4a61cf9ff8b84e559493dedc5', 'DESKTOP_SESSION': 'default', 'DESKTOP_STARTUP_ID': '', 'DISPLAY': ':0.0', 'DJANGO_SETTINGS_MODULE': 'veryvote.settings', 'GATEWAY_INTERFACE': 'CGI/1.1', 'GDMSESSION': 'default', 'GDM_LANG': 'zh_CN.UTF-8', 'GDM_XSERVER_LOCATION': 'local', 'GNOME_DESKTOP_SESSION_ID': 'Default', 'GNOME_KEYRING_PID': '6157', 'GNOME_KEYRING_SOCKET': '/tmp/ keyring-v5G1n2/socket', 'GPG_AGENT_INFO': '/tmp/seahorse-EcHJt8/S.gpg- agent:6219:1', 'GTK_IM_MODULE': 'scim-bridge', 'GTK_RC_FILES': '/etc/ gtk/gtkrc:/home/chris/.gtkrc-1.2-gnome2', 'HISTCONTROL': 'ignoreboth', 'HOME': '/home/chris', 'HTTP_ACCEPT': 'text/html,application/xhtml +xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'gb2312,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'zh-cn,zh;q=0.5', 'HTTP_CACHE_CONTROL': 'max- age=0', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=e5e21e8250914db63f93569c0bdb282c', 'HTTP_HOST': 'localhost: 8000', 'HTTP_KEEP_ALIVE': '300', 'HTTP_REFERER': 'http://localhost: 8000/vote/add/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.0.4) Gecko/2008111317 Ubuntu/8.04 (hardy) Firefox/ 3.0.4', 'JAVA_HOME': '/usr/lib/jvm/java-6-sun', 'LANG': 'zh_CN.UTF-8', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LESSOPEN': '| /usr/bin/ lesspipe %s', 'LOGNAME': 'chris', 'LS_COLORS': 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*. 7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:', 'OLDPWD': '/home/chris', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/ sbin:/usr/bin:/sbin:/bin:/usr/games', 'PATH_INFO': u'/vote/add/', 'PWD': '/home/chris/workspace/veryvote', 'QT_IM_MODULE': 'xim', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_HOST': '', 'REQUEST_METHOD': 'POST', 'RUN_MAIN': 'true', 'SCRIPT_NAME': u'', 'SERVER_NAME': 'localhost', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.5.2', 'SESSION_MANAGER': 'local/chris-Legend:/tmp/.ICE-unix/6162', 'SHELL': '/bin/bash', 'SHLVL': '1', 'SSH_AUTH_SOCK': '/tmp/keyring-v5G1n2/ssh', 'TERM': 'xterm', 'TZ': 'Asia/Shanghai', 'USER': 'chris', 'USERNAME': 'chris', 'WINDOWID': '65011804', 'WINDOWPATH': '7', 'XAUTHORITY': '/ home/chris/.Xauthority', 'XDG_DATA_DIRS': '/usr/local/share/:/usr/ share/:/usr/share/gdm/', 'XDG_SESSION_COOKIE': 'd4eca9b1c5cb470d46b4e19148d5093c-1228795330.953588-382266091', 'XMODIFIERS': '@im=SCIM', '_': '/usr/bin/python', 'wsgi.errors': <open file '<stderr>', mode 'w' at 0xb7dd60b0>, 'wsgi.file_wrapper': <class 'django.core.servers.basehttp.FileWrapper'>, 'wsgi.input': <socket._fileobject object at 0x873bed4>, 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> tag u'\u7231\u597d' template 'vote/add.html' title u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c' * /usr/lib/python2.5/site-packages/django/db/models/manager.py in create 92. def get(self, *args, **kwargs): 93. return self.get_query_set().get(*args, **kwargs) 94. 95. def get_or_create(self, **kwargs): 96. return self.get_query_set().get_or_create(**kwargs) 97. 98. def create(self, **kwargs): 99. return self.get_query_set().create(**kwargs) ... 100. 101. def filter(self, *args, **kwargs): 102. return self.get_query_set().filter(*args, **kwargs) 103. 104. def complex_filter(self, *args, **kwargs): 105. return self.get_query_set().complex_filter(*args, **kwargs) ▶ Local vars Variable Value kwargs {'anonymous_able': False, 'author': <User: 小青豆>, 'club_choose': None, 'club_only': False, 'description': u'\u4f60\u662f\u5426\u559c \u6b22\u5531\u6b4c', 'end_date': datetime.datetime(2008, 12, 29, 0, 0), 'new_choice_able': False, 'pub_date': datetime.datetime(2008, 12, 9, 20, 53, 18, 140860), 'tag': u'\u7231\u597d', 'title': u'\u4f60\u662f \u5426\u559c\u6b22\u5531\u6b4c'} self <django.db.models.manager.Manager object at 0x86dd88c> * /usr/lib/python2.5/site-packages/django/db/models/query.py in create 312. 313. def create(self, **kwargs): 314. """ 315. Creates a new object with the given kwargs, saving it to the database 316. and returning the created object. 317. """ 318. obj = self.model(**kwargs) 319. obj.save(force_insert=True) ... 320. return obj 321. 322. def get_or_create(self, **kwargs): 323. """ 324. Looks up an object with the given kwargs, creating one if necessary. 325. Returns a tuple of (object, created), where created is a boolean ▶ Local vars Variable Value kwargs {'anonymous_able': False, 'author': <User: 小青豆>, 'club_choose': None, 'club_only': False, 'description': u'\u4f60\u662f\u5426\u559c \u6b22\u5531\u6b4c', 'end_date': datetime.datetime(2008, 12, 29, 0, 0), 'new_choice_able': False, 'pub_date': datetime.datetime(2008, 12, 9, 20, 53, 18, 140860), 'tag': u'\u7231\u597d', 'title': u'\u4f60\u662f \u5426\u559c\u6b22\u5531\u6b4c'} obj <Vote: 你是否喜欢唱歌> self [<Vote: 你是否喜欢唱歌>] * /usr/lib/python2.5/site-packages/django/db/models/base.py in save 304. The 'force_insert' and 'force_update' parameters can be used to insist 305. that the "save" must be an SQL insert or update (or equivalent for 306. non-SQL backends), respectively. Normally, they should not be set. 307. """ 308. if force_insert and force_update: 309. raise ValueError("Cannot force both insert and updating in " 310. "model saving.") 311. self.save_base(force_insert=force_insert, force_update=force_update) ... 312. 313. save.alters_data = True 314. 315. def save_base(self, raw=False, cls=None, force_insert=False, 316. force_update=False): 317. """ ▶ Local vars Variable Value force_insert True force_update False self <Vote: 你是否喜欢唱歌> * /usr/lib/python2.5/site-packages/django/db/models/base.py in save_base 364. raise DatabaseError("Forced update did not affect any rows.") 365. else: 366. record_exists = False 367. if not pk_set or not record_exists: 368. if not pk_set: 369. if force_update: 370. raise ValueError("Cannot force an update in save() with no primary key.") 371. values = [(f, f.get_db_prep_save(raw and getattr(self, f.attname) or f.pre_save(self, True))) for f in meta.local_fields if not isinstance(f, AutoField)] ... 372. else: 373. values = [(f, f.get_db_prep_save(raw and getattr(self, f.attname) or f.pre_save(self, True))) for f in meta.local_fields] 374. 375. if meta.order_with_respect_to: 376. field = meta.order_with_respect_to 377. values.append((meta.get_field_by_name('_order')[0], manager.filter(**{field.name: getattr(self, field.attname)}).count())) ▶ Local vars Variable Value _[3] [(<django.db.models.fields.CharField object at 0x86d9b0c>, u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c'), (<django.db.models.fields.CharField object at 0x86d99cc>, u'\u4f60\u662f\u5426\u559c\u6b22\u5531\u6b4c'), (<django.db.models.fields.related.ForeignKey object at 0x86d994c>, 3), (<django.db.models.fields.DateTimeField object at 0x86d9a0c>, u'2008-12-09 20:53:18'), (<django.db.models.fields.BooleanField object at 0x86d9a2c>, False), (<django.db.models.fields.DateTimeField object at 0x86d9aec>, u'2008-12-29 00:00:00'), (<django.db.models.fields.BooleanField object at 0x86d9acc>, False), (<django.db.models.fields.BooleanField object at 0x86d9a8c>, False), (<django.db.models.fields.BooleanField object at 0x86d9c6c>, False), (<django.db.models.fields.BooleanField object at 0x86d9b4c>, False), (<django.db.models.fields.CharField object at 0x86dd0cc>, u'AA')] cls <class 'veryvote.vote.models.Vote'> f <django.db.models.fields.related.ForeignKey object at 0x86dd10c> force_insert True force_update False manager <django.db.models.manager.Manager object at 0x86dd88c> meta <Options for Vote> non_pks [<django.db.models.fields.CharField object at 0x86d9b0c>, <django.db.models.fields.CharField object at 0x86d99cc>, <django.db.models.fields.related.ForeignKey object at 0x86d994c>, <django.db.models.fields.DateTimeField object at 0x86d9a0c>, <django.db.models.fields.BooleanField object at 0x86d9a2c>, <django.db.models.fields.DateTimeField object at 0x86d9aec>, <django.db.models.fields.BooleanField object at 0x86d9acc>, <django.db.models.fields.BooleanField object at 0x86d9a8c>, <django.db.models.fields.BooleanField object at 0x86d9c6c>, <django.db.models.fields.BooleanField object at 0x86d9b4c>, <django.db.models.fields.CharField object at 0x86dd0cc>, <django.db.models.fields.related.ForeignKey object at 0x86dd10c>, <django.db.models.fields.IntegerField object at 0x86dd12c>, <django.db.models.fields.DateTimeField object at 0x86dd1ac>, <django.db.models.fields.CharField object at 0x86dd1ec>] pk_set False pk_val None raw False record_exists True self <Vote: 你是否喜欢唱歌> signal True * /usr/lib/python2.5/site-packages/django/db/models/fields/ related.py in get_db_prep_save 658. return getattr(field_default, self.rel.get_related_field ().attname) 659. return field_default 660. 661. def get_db_prep_save(self, value): 662. if value == '' or value == None: 663. return None 664. else: 665. return self.rel.get_related_field().get_db_prep_save (value) ... 666. 667. def value_to_string(self, obj): 668. if not obj: 669. # In required many-to-one fields with only one available choice, 670. # select that one available choice. Note: For SelectFields 671. # we have to check that the length of choices is *2*, not 1, ▶ Local vars Variable Value self <django.db.models.fields.related.ForeignKey object at 0x86dd10c> value u'AA' * /usr/lib/python2.5/site-packages/django/db/models/fields/ __init__.py in get_db_prep_save 185. Used by the default implementations of ``get_db_prep_save``and 186. `get_db_prep_lookup``` 187. """ 188. return value 189. 190. def get_db_prep_save(self, value): 191. "Returns field's value prepared for saving into a database." 192. return self.get_db_prep_value(value) ... 193. 194. def get_db_prep_lookup(self, lookup_type, value): 195. "Returns field's value prepared for database lookup." 196. if hasattr(value, 'as_sql'): 197. sql, params = value.as_sql() 198. return QueryWrapper(('(%s)' % sql), params) ▶ Local vars Variable Value self <django.db.models.fields.AutoField object at 0x8636dcc> value u'AA' * /usr/lib/python2.5/site-packages/django/db/models/fields/ __init__.py in get_db_prep_value 346. except (TypeError, ValueError): 347. raise exceptions.ValidationError( 348. _("This value must be an integer.")) 349. 350. def get_db_prep_value(self, value): 351. if value is None: 352. return None 353. return int(value) guys, please help me. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---