Source

cmsplugin-contact / cmsplugin_contact / models.py

Diff from to

cmsplugin_contact/models.py

 from django.db import models
 from django.utils.translation import ugettext_lazy as _
 from cms.models import CMSPlugin
+from django.db import models
+import datetime
+
+class ContactData(models.Model):
+    username = models.CharField(_(u'Forename Name / Company'), max_length=128, blank=False)
+    email = models.EmailField(_(u'Email'), blank=False)
+    phone = models.CharField(_(u'Phone'), max_length=30, blank=True)
+    subject = models.TextField(_(u'Message'), blank=True)
+    content = models.TextField(_(u'Message'), blank=True)
+    created = models.DateTimeField(_('Created'), default=datetime.datetime.now, db_index=True)
 
 # Feel free to extend this class instead of Contact.
 class BaseContact(CMSPlugin):
     )
     
     site_email = models.EmailField(_('Email recipient'))
+    username_label = models.CharField(_('Username sender label'),
+                                   default=_('Your username'),
+                                   max_length=100)
     email_label = models.CharField(_('Email sender label'),
                                    default=_('Your email address'),
                                    max_length=100)
+    phone_label = models.CharField(_('Phone sender label'),
+                                   default=_('Your phone'),
+                                   max_length=100)
     subject_label = models.CharField(_('Subject label'),
                                      default=_('Subject'), max_length=200)
     content_label = models.CharField(_('Message content label'),
                                      default=_('Message'), max_length=100)
+    extra_info_content = models.TextField(verbose_name=_("Extra info"),
+        help_text=_('Message displayed before buttons'),
+        default='', max_length=400)
     thanks = models.TextField(
         verbose_name=_("Thanks message"),
         help_text=_('Message displayed on successful submit'),