Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 57 lines (47 sloc) 2.106 kb
325edfe @maccesch renaming
authored
1 from django.db import models
2 from django.utils.translation import ugettext_lazy as _
7846a38 @maccesch included glamkit-stopspam for simplicity
authored
3 from cms.models import CMSPlugin
325edfe @maccesch renaming
authored
4
8ab1532 @dsh2dsh Add ability to subclass the plugin.
dsh2dsh authored
5 # Feel free to extend this class instead of Contact.
6 class BaseContact(CMSPlugin):
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
7 SPAM_PROTECTION_CHOICES = (
8 (0, 'Honeypot'),
9 (1, 'Akismet'),
10 (2, 'ReCAPTCHA'),
11 )
325edfe @maccesch renaming
authored
12
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
13 THEME_CHOICES = (
14 ('clean', 'Clean'),
15 ('red', 'Red'),
16 ('white', 'White'),
17 ('blackglass', 'Black Glass'),
325edfe @maccesch renaming
authored
18 ('custom', 'Custom'),
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
19 )
325edfe @maccesch renaming
authored
20
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
21 site_email = models.EmailField(_('Email recipient'))
19dca8c @Lacrymology style fix
Lacrymology authored
22 email_label = models.CharField(_('Email sender label'),
23 default=_('Your email address'),
24 max_length=100)
25 subject_label = models.CharField(_('Subject label'),
26 default=_('Subject'), max_length=200)
27 content_label = models.CharField(_('Message content label'),
28 default=_('Message'), max_length=100)
29 thanks = models.TextField(
30 verbose_name=_("Thanks message"),
31 help_text=_('Message displayed on successful submit'),
32 default=_('Thank you for your message.'), max_length=200)
33 submit = models.CharField(_('Submit button value'),
34 default=_('Submit'), max_length=30)
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
35
19dca8c @Lacrymology style fix
Lacrymology authored
36 spam_protection_method = models.SmallIntegerField(
37 verbose_name=_('Spam protection method'),
38 choices=SPAM_PROTECTION_CHOICES, default=0)
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
39
40 akismet_api_key = models.CharField(max_length=255, blank=True)
41
42 recaptcha_public_key = models.CharField(max_length=255, blank=True)
43 recaptcha_private_key = models.CharField(max_length=255, blank=True)
19dca8c @Lacrymology style fix
Lacrymology authored
44 recaptcha_theme = models.CharField(max_length=20,
45 choices=THEME_CHOICES,
46 default='clean',
47 verbose_name=_('ReCAPTCHA theme'))
8ab1532 @dsh2dsh Add ability to subclass the plugin.
dsh2dsh authored
48
49 class Meta:
50 abstract = True
988c615 Convert tabs to 4 spaces to be more consistent with other files in th…
dries authored
51
52 def __unicode__(self):
53 return self.site_email
8ab1532 @dsh2dsh Add ability to subclass the plugin.
dsh2dsh authored
54
55 class Contact(BaseContact):
56 pass
Something went wrong with that request. Please try again.