1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/project/pages/views/about.py

29 lines
760 B
Python
Raw Normal View History

2016-01-26 18:25:20 +00:00
from project.common.views import CustomTemplate, CustomFormTemplate
from project.common.forms import ContactForm
class WebsiteView(CustomTemplate):
template_name = 'about/website.html'
html_title = "About website"
class IndexView(CustomFormTemplate):
template_name = 'about/index.html'
html_title = "About"
success_url = '/about/?sent'
form_class = ContactForm
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['sent'] = 'sent' not in self.request.GET
return context
def form_valid(self, form):
form.send_email()
return super().form_valid(form)
class MeView(CustomTemplate):
template_name = 'about/me.html'
html_title = "About Me"