问题标签 [cleaned-data]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 'NoneType' 对象在 django rest 框架中不可下标
我试图在 django restframework 中接收 json 格式的数据并立即使用这些数据,但我意识到我收到“NoneType”对象不可下标的错误,我觉得我需要使用cleaned_data,但我不知道如何在rest 中使用cleaned_data框架...这是我的代码:
这是我的回溯错误:
[那是下面出现的错误图像][1] [1]:https://i.stack.imgur.com/wkOwa.png
django - 在从 Django 管理员上传多个文件之前验证字段
伙计们!我是 Django 的初学者,我已经看到了这个答案How to upload multiple files from the Django admin? 关于从 django admin 上传多个文件,但我想知道如何仅在位于其子内联表单的上传字段已选择文件的情况下验证管理主表单中的此类字段?
提前致谢。