【发布时间】:2021-09-17 03:19:48
【问题描述】:
我需要像这样发送一个 json 对象:
{
"title": "tour1",
"description": "lets go updated",
"date_time": "2021-06-30T06:14:00Z",
"time_zone": "Africa/Abidjan",
"host": 1,
"is_private": true,
"is_virtual": false,
"url": "www.google.com",
"photos": [
{
"image": "http://127.0.0.1:8000/meeting-photos/1.jpg"
},
{
"image": "http://127.0.0.1:8000/meeting-photos/5.jpg"
},
{
"image": "http://127.0.0.1:8000/meeting-photos/3_Os8n2RX.jpg"
}
],
"location":{
"lat": "0.0000000000000003",
"lng": "0.0000000000000002"
}
}
基于此question and answer ,我将嵌套位置字段进行批量编辑,结果如下: 但是当我发布 json 时,我得到了这个错误:
KeyError: 'location'
我应该怎么做才能解决这个错误?
【问题讨论】: