Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含 FileField 的模型。不过,我通过 API 调用手动保存文件,因此我不希望模型为 FileField 上传任何内容,但我确实希望它保存文件名和位置。这可以做到吗?
当您不使用模型表单来保存数据时,不会将文件添加到文件系统中。所以文件字段只是一个指向正确位置的字符串。