【发布时间】:2019-01-26 10:07:29
【问题描述】:
如果我正确阅读了文档,那么 Django 中的 FileField 不知道文件的 content_type:https://docs.djangoproject.com/en/2.1/ref/models/fields/
我想在 Django 应用程序中存储文件,但我想查询 content_type。
例子:
- 列出所有文件内容类型为“application/pdf”的对象
- 列出所有具有内容类型为“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”的文件的对象
处理这个最像 django 的方式是什么?
【问题讨论】: