Adding an Export Format for files in Django Admin

Helloo,

I have added the ImportExportActionModelAdmin function in my Admin for Project, but I can not find the option to choose the format of the file to download and option to export orders.

I have followed the following documnetation about Import and Export but still the action function didn't appear

https://django-import-export.readthedocs.io/en/latest/getting_started.html#exporting-via-admin-action

How do I add that option to download features?

enter image description here

Here is the admin.py

def order_pdf(obj):
    return mark_safe('<a href="{}">PDF</a>'.format(reverse('core:admin_order_pdf', args=[obj.id])))


order_pdf.short_description = 'Order PDF'

class OrderAdmin(ImportExportActionModelAdmin):
    list_display = ['id', ....., order_pdf]


Read more here: https://stackoverflow.com/questions/64409813/adding-an-export-format-for-files-in-django-admin

Content Attribution

This content was originally published by A_K at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: