django-markdownx/testapp/views.py

28 lines
615 B
Python
Raw Normal View History

2016-12-04 18:36:41 +00:00
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView, CreateView
from testapp.models import MyModel
from testapp.forms import MyForm
class IndexTemplateView(TemplateView):
template_name = 'index.html'
2017-04-23 18:14:08 +00:00
2016-12-04 18:36:41 +00:00
class TestFormView(FormView):
template_name = "test_form_view.html"
form_class = MyForm
success_url = '/'
2017-04-23 18:14:08 +00:00
2016-12-04 18:36:41 +00:00
class TestCreateView(CreateView):
template_name = "test_create_view.html"
model = MyModel
success_url = '/'
2017-04-23 18:14:08 +00:00
fields = [
'markdownx_field1',
'markdownx_field2',
'textfield1',
'textfield2'
]