mise-en-production
[auf_framonde.git] / project / cmsplugin_contact_plus / admin.py
1 from django.contrib import admin
2 from django.http import HttpResponse
3
4 from inline_ordering.admin import OrderableStackedInline
5 from .models import ExtraField, ContactPlus, ContactRecord
6
7 from .actions import export_as_csv_action
8
9 class ExtraFieldInline(OrderableStackedInline):
10 model = ExtraField
11
12
13 class ContactFormPlusAdmin(admin.ModelAdmin):
14 model = ContactPlus
15 inlines = (ExtraFieldInline, )
16
17
18 class ContactRecordAdmin(admin.ModelAdmin):
19 model = ContactRecord
20 actions = [export_as_csv_action("CSV Export",
21 fields = ['contact_form', 'date_of_entry', 'date_processed', 'data'],
22 header = True,
23 json_fields = ['data']), #
24 ]
25
26
27 admin.site.register(ExtraField)
28
29 admin.site.register(ContactRecord, ContactRecordAdmin)
30 admin.site.register(ContactPlus, ContactFormPlusAdmin)