使用 Django-import-export 导入空白 TextField
想象一下,我的数据库中存储了数据。一个模型包含一个带有blamn = true
的django textfield,但根据django justnuction,没有null = true
。数据是通过Admin-Menu
创建的。空的文本场被存储为空字符串,效果很好。但是导入django-import-export抛出违反了无效约束细节:失败行包含
。这是django-import export的问题吗?
Imagine I have data stored in my database. A model contains a Django TextField with blank=True
but without null=True
according to Django convention. The data were created via the admin-menu
. Empty TextFields are stored as empty strings which works just fine. But import trough django-import-export throws violates not-null constraint DETAIL: Failing row contains
. Is this a problem of django-import-export?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

如果您是从Excel导入的,则必须给出空字符串(''),而不是Excel中的空列。
If you are importing from excel, you will have to give empty string('') instead of empty columns in excel.