Ability to add multiple custom exports to ModelAdmin
See original GitHub issueI would like to be able to export different datasets. I currently have this for exporting a model and related data:
class GameAdmin(ExportMixin, admin.ModelAdmin):
resource_class = GameResource
# ...
However Games also have Levels, what I would like is having a mechanism to add multiple custom exports similar to how https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter works:
class GameAdmin(ExportMixin, admin.ModelAdmin):
resource_class = [LevelsResource, GameResource]
# ...
Which would let me export Level data.
Issue Analytics
- State:
- Created 11 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Django import export add on existing admin - Stack Overflow
class BookAdmin(admin.ModelAdmin):. So I need to try to add import/export class with some different name like class BookAdminExport, but then I ...
Read more >How to Import or Export Data from Django Admin
In this article, I am going to show you a very easy way to add import/export functionality to Django Admin.
Read more >Django Import Export Tricks & Tips - Dev Genius
Django Import Export Tricks & Tips · Look Up in Foreignkey and ManyToMany fields · Custom Dropdown Widgets · Skip Rows (Avoid Duplicate...
Read more >2. How to export CSV from Django admin? - Books by Agiliq
You have been asked to add ability to export Hero and Villain from the admin. There are a number of third party apps...
Read more >Admin actions - Django documentation
If you wish to override this behavior, you can override ModelAdmin.delete_queryset() or write a custom action which does deletion in your preferred manner ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think, this issue has to reopen I am using django import and export in django admin
But we want multiple types of export for the same model Eg. We have investors model We want exports like
having an option to use multiple resource classes will be very handy
I have models with various M2M relationships and sometimes can get export data for only some of those without a need 2 touch the rest
it’s all doable using export first, etc etc + there’s a workaround with Proxy Models but would be much easier to choose the resource class when you need to update just some (sets) of the data