이러한 유형의 문제를 점점에 양식을 업데이트하려고하면내가 장고 내가 DB에서 이러한 유형의 값을 저장
INPUT :
{
"PatientProfile__is_recruiter": "1",
"PatientProfile__partner": "FMCS",
"PatientProfile__health_insurance_provider": "MILITARY/VA",
"PatientProfile__has_medical_home": "0",
"PatientProfile__medical_history_heart_disease": "0",
"PatientProfile__medical_history_hypertension": "0",
"data_model_name": [
"PatientProfile"
]
}
내가 업데이트하려고하고 내가 같은 결과를 발견 업데이트 한 후 같은 :
{
"PatientProfile__is_recruiter": "1",
"PatientProfile__partner": "FMCS",
"PatientProfile__health_insurance_provider": "MILITARY/VA",
"PatientProfile__has_medical_home": "0",
"PatientProfile__medical_history_heart_disease": "0",
"PatientProfile__medical_history_hypertension": "0",
"data_model_name": [
"PatientProfile"
]
}
이 코드를 업데이트하고 DB로 가져 오기 및 실행하려고하지 않을 경우. 나는 어떤 오류도 내지 않는다. 업데이트 후이 코드를 실행하려고합니다. 나는 아래 점점 오류 정의하고있다 :
역 추적 (마지막으로 가장 최근 통화) :
이File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/ubuntu/django-apps/project_name/../project_name/apps/accounts/decorators.py", line 44, in inner_decorator
return func(request, *args, **kwargs)
File "/home/ubuntu/django-apps/project_name/../project_name/apps/reports/views.py", line 97, in hiv_report_new
return form.get_itable(pk)
File "/home/ubuntu/django-apps/project_name/../project_name/apps/reports/forms.py", line 454, in get_itable
custom_data = ast.literal_eval(report_qs[0]['query'])
File "/usr/lib/python2.6/ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python2.6/ast.py", line 37, in parse
return compile(expr, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
{
^
SyntaxError: invalid syntax
임의의 Javascript 및 PHP 태그를 추가해도 순전히 파이썬 인 경우 질문에 대한 답변을 얻을 수 없습니다. 어쨌든, 당신은 틀림없이 오류의 원인이되는 forms.py 부분을 보여 주어야 할 것입니다. –