django-simplecms/example/views.py

31 wiersze
754 B
Python
Czysty Zwykły widok Historia

2020-03-22 18:57:48 +00:00
from django.utils.translation import gettext_lazy as _
from cms.views import SectionView, SectionFormView
from cms.decorators import section_view
from cms.forms import ContactForm
@section_view
class Text(SectionView):
verbose_name = _('Text')
2020-03-22 18:57:48 +00:00
fields = ['content']
template_name = 'text.html'
@section_view
class Images(SectionView):
2020-03-22 18:57:48 +00:00
verbose_name = _('Image(s)')
fields = ['images']
template_name = 'images.html'
@section_view
class Video(SectionView):
verbose_name = _('Video')
2020-03-22 18:57:48 +00:00
fields = ['video']
template_name = 'video.html'
@section_view
class Contact(SectionFormView):
verbose_name = _('Contact')
2020-03-22 18:57:48 +00:00
fields = []
form_class = ContactForm
success_url = '/thanks/'
2020-03-22 18:57:48 +00:00
template_name = 'contact.html'