我正在尝试更新包含表单中图像字段的模型,如下所示 在我的 views.py:
中if request.method == "POST" and 'submit_business' in request.POST:
id = request.POST.get('update_business')
for object in Object.objects.filter(id=id):
object.photo = request.FILES.get('photo')
object.save()
它会抛出错误:'QueryDict' object has no attribute 'FILES'
\