-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathmodels.py
More file actions
32 lines (28 loc) · 960 Bytes
/
models.py
File metadata and controls
32 lines (28 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from django.db import models
from wagtail.fields import RichTextField
from wagtail.admin.panels import (
FieldPanel,
MultiFieldPanel,
)
from wagtail.contrib.settings.models import (
BaseGenericSetting,
register_setting,
)
@register_setting
class PopupSettings(BaseGenericSetting):
preview_text = RichTextField()
popup_title = models.CharField(max_length=255)
popup_text = RichTextField()
active = models.BooleanField(default=True)
show_on_first_view = models.BooleanField(default=True)
days_between_appearing = models.IntegerField(default=7)
seconds_delay_before_appearing = models.IntegerField(default=90)
panels = [
FieldPanel('preview_text'),
FieldPanel('popup_title'),
FieldPanel('popup_text'),
FieldPanel('active'),
FieldPanel('show_on_first_view'),
FieldPanel('days_between_appearing'),
FieldPanel('seconds_delay_before_appearing'),
]