-
-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When choose 'By Question" or "By Category" ans using "date" type, Object of type 'date' is not JSON serializable #105
Comments
Hello, thank you for the bug report, would you have the full stacktrace of the error please ? |
I don't know full stacktrace. so I copy some infomation in the trackback section. Environment:
Traceback:
|
Thanks, if giving your passwords hashes is not a problem would appreciate to have the dump of the database to reproduce the problem. Can you upload |
Ok, I can give you my info. Let me know your contact email address. I'll reply. |
open again. sorry. |
Don't worry I don't need your password, I can create another super user :) |
You can use my site now. when you fill 'foundation date 설립일' and press "I'm done". you can see that error msg. |
Hi again, I tried to load the json dump but I had a problem with a new field called "ext" |
Sorry, I modified some code. I also removed that code. ( ext) ^^; test1 is no problem. it has date field in last category. but, test2 has some problem. Environment:
Traceback:
|
@turbok2 sorry for out of topic question, how did you remove "Answer This Part" text? its always appear in my survey even if there is only i category or less used |
If you change some code in html file, you can control. |
Seems like when you try to change the way the questions are displayed from the default, "All questions in one page" to any other display settings of the survey, you get this error of the Date not being JSON serializable when you try to navigate to the next category/ question. My stack trace is as below.
|
Right!! in other options except "All questions in one page", I got an error. |
Has there been any progress on this? I have the same issue |
I'm not developing anymore on this project, but I review and merge contributions :) |
When choose 'By Question" or "By Category" ans using "date" type,
there is an error like below:
When I choice date at first page and click 'I'm done'
In case I made questions using 'By category' and more then 2 category.
It's okay. when i use "All in one page"
or when I made questions with 1 category or put a question (date) at last page.
I use new version.( I cloned 2021-03-15)
http://127.0.0.1:8000/survey/12/
2.2.2
TypeError
Object of type 'date' is not JSON serializable
/home/turbo/anaconda3/lib/python3.6/json/encoder.py in default, line 180
/home/turbo/django/venv/bin/python
3.6.10
['/home/turbo/django/django-survey', '/home/turbo/study/models/research', '/home/turbo/study/models/research/slim', '/home/turbo/study/now/Mask_RCNN/cocoapi/PythonAPI', '/home/turbo/django/venv/lib/python36.zip', '/home/turbo/django/venv/lib/python3.6', '/home/turbo/django/venv/lib/python3.6/lib-dynload', '/home/turbo/anaconda3/lib/python3.6', '/home/turbo/django/venv/lib/python3.6/site-packages']
Mon, 15 Mar 2021 11:55:09 +0900
traceback
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/survey/12/
Django Version: 2.2.2
Python Version: 3.6.10
Installed Applications:
('django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'survey',
'bootstrapform',
'rosetta',
'debug_toolbar')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')
Traceback:
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/utils/deprecation.py" in call
96. response = self.process_response(request, response)
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/contrib/sessions/middleware.py" in process_response
58. request.session.save()
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in save
83. obj = self.create_model_instance(data)
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py" in create_model_instance
70. session_data=self.encode(data),
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/contrib/sessions/backends/base.py" in encode
95. serialized = self.serializer().dumps(session_dict)
File "/home/turbo/django/venv/lib/python3.6/site-packages/django/core/signing.py" in dumps
87. return json.dumps(obj, separators=(',', ':')).encode('latin-1')
File "/home/turbo/anaconda3/lib/python3.6/json/init.py" in dumps
238. **kw).encode(obj)
File "/home/turbo/anaconda3/lib/python3.6/json/encoder.py" in encode
199. chunks = self.iterencode(o, _one_shot=True)
File "/home/turbo/anaconda3/lib/python3.6/json/encoder.py" in iterencode
257. return _iterencode(o, 0)
File "/home/turbo/anaconda3/lib/python3.6/json/encoder.py" in default
180. o.class.name)
Exception Type: TypeError at /survey/12/
Exception Value: Object of type 'date' is not JSON serializable
The text was updated successfully, but these errors were encountered: