From: Radek Czajka Date: Thu, 26 Mar 2020 13:38:45 +0000 (+0100) Subject: Export contacts as CSV. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/3c6061e46736c8673316f609ad5b5cb86dcd7096?ds=inline;hp=4af7ac8eb45833fc3251d799ef48cd834183901e Export contacts as CSV. --- diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 19f36129f..e3bfb9cee 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -2,7 +2,7 @@ # django Django==2.2.10 -fnpdjango==0.4 +fnpdjango==0.4.5 docutils #django-pipeline==1.6.13 diff --git a/src/messaging/admin.py b/src/messaging/admin.py index 4ea538f62..6749106d6 100644 --- a/src/messaging/admin.py +++ b/src/messaging/admin.py @@ -1,6 +1,7 @@ from django.contrib import admin from django.contrib import messages from django.utils.translation import ugettext_lazy as _ +from fnpdjango.actions import export_as_csv_action from . import models @@ -83,6 +84,7 @@ class ContactAdmin(admin.ModelAdmin): list_display = ['email', 'level', 'since', 'expires_at'] search_fields = ['email'] date_hierarchy = 'since' + actions = [export_as_csv_action(fields=['id', 'email', 'get_level_display', 'since', 'expires_at'])] admin.site.register(models.Contact, ContactAdmin)