1. Konrad Rymczak
  2. cmsplugin-contact

Source

cmsplugin-contact / cmsplugin_contact / admin.py

Diff from to

File cmsplugin_contact/admin.py

  • Ignore whitespace
+# -*- coding: utf-8 -*-
+
 from django.forms import ModelForm, Field, CharField, HiddenInput
 from django.forms.util import ErrorList
 from django.core.exceptions import ValidationError
 from django.contrib.sites.models import Site
 from django.conf import settings
 from django.utils.translation import ugettext_lazy as _
+from django.contrib import admin
+from models import Contact, ContactData
 
-from models import Contact
+class ContactDataAdmin(admin.ModelAdmin):
+    list_display = ('username', 'email', 'phone', 'content', 'created')
+    date_hierarchy = 'created'
+    search_fields = ('username', 'email', 'phone', 'content', 'created')
+
+admin.site.register(ContactData, ContactDataAdmin)
 
 class KeyField(CharField):
     def validate(self, value):
         # valdates always. validation is done in the form (see below)
         pass
 
+
+
 class ContactAdminForm(ModelForm):
     akismet_api_key = KeyField(max_length=255, label=_("Akismet API Key"), help_text=_('Get a Wordpress Key from http://akismet.com/'))