我如何将导入导出添加到 table 并在 Django 中对列进行排序

How can i add import export to a table and also order the columns in django

我想添加导入导出按钮,同时订购 table 列

class OrderEtudiant(admin.ModelAdmin):
 list_display = ('id_etudiant','nom_etudiant','prenom_etudiant','Telephone','Adresse','Filiere')
 search_fields = ('nom_etudiant',)

class userdat(ImportExportModelAdmin):
     pass

admin.site.register(Etudiant,userdat,OrderEtudiant)

这是我无法传递三个参数的问题

ImportExportModelAdmin is a subclass of ModelAdmin 起,您可以按如下方式重写此代码段:

class OrderEtudiant(ImportExportModelAdmin):
    list_display = ('id_etudiant','nom_etudiant','prenom_etudiant','Telephone','Adresse','Filiere')
    search_fields = ('nom_etudiant',)

admin.site.register(Etudiant,OrderEtudiant)