django-import-export无法正常工作 [英] django-import-export can not get it working
本文介绍了django-import-export无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无法执行此操作, 已安装,添加到应用中,并遵循文档.没有. 这是我的admin.py:
Can not get this to do anything, installed, added to apps, followed the docs. nothing. here's my admin.py:
from import_export import resources
from import_export.admin import ImportExportModelAdmin
class EmailGroupResource(resources.ModelResource):
class Meta:
model = EmailGroup
class EmailGroupAdmin(DjangoObjectActions, ImportExportModelAdmin, admin.ModelAdmin):
resource_class = EmailGroupResource
.. rest of admin
admin.site.register(EmailGroup, EmailGroupAdmin)
也许我有冲突? 使用Mezzanine4.0
Maybe i have a conflict? using Mezzanine4.0
请帮助!
推荐答案
如果您已经从admin.ModelAdmin
继承,则比使用mixin更有意义import_export.admin.ImportExportMixin
(请参阅:
If you are already inherit from admin.ModelAdmin
, than using mixin would make more sense import_export.admin.ImportExportMixin
(see: https://django-import-export.readthedocs.org/en/latest/getting_started.html#admin-integration)
如果未显示按钮,则DjangoObjectActions
可能会覆盖管理模板.
If buttons do not appear, it is possible that DjangoObjectActions
overrides admin template.
这篇关于django-import-export无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文