This commit is contained in:
Eden Kirin
2024-04-06 12:16:22 +02:00
parent 4e05dc15a5
commit ae2612cfd6
19 changed files with 148 additions and 10 deletions

View File

@ -1 +1,6 @@
from .complex_form import ComplexFormView
from .filter_list import FilterListView
from .form_validation import FormValidationView
from .home import HomeView
from .swap_content import SwapContentView
from .table_inline_edit import TableInlineEditView

View File

@ -0,0 +1,7 @@
from project.main.views.demo_view_base import DemoViewBase
class ComplexFormView(DemoViewBase):
template_name = "main/complex_form.html"
active_section = "complex-form"
title = "Complex Form"

View File

@ -0,0 +1,20 @@
from typing import Any
from django.core.handlers.wsgi import WSGIRequest
from django.http import HttpResponse
from django.views.generic import TemplateView
class DemoViewBase(TemplateView):
active_section = None
title = None
def get_context_data(self, **kwargs) -> dict[str, Any]:
return {
"title": self.title,
"active_section": self.active_section,
}
def get(self, request: WSGIRequest, *args, **kwargs) -> HttpResponse:
context = self.get_context_data(**kwargs)
return self.render_to_response(context)

View File

@ -0,0 +1,7 @@
from project.main.views.demo_view_base import DemoViewBase
class FilterListView(DemoViewBase):
template_name = "main/filter_list.html"
active_section = "filter-list"
title = "Filter List"

View File

@ -0,0 +1,7 @@
from project.main.views.demo_view_base import DemoViewBase
class FormValidationView(DemoViewBase):
template_name = "main/form_validation.html"
active_section = "form-validation"
title = "Form Validation"

View File

@ -0,0 +1,7 @@
from project.main.views.demo_view_base import DemoViewBase
class SwapContentView(DemoViewBase):
template_name = "main/swap_content.html"
active_section = "swap-content"
title = "Swap Content"

View File

@ -0,0 +1,7 @@
from project.main.views.demo_view_base import DemoViewBase
class TableInlineEditView(DemoViewBase):
template_name = "main/table_inline_edit.html"
active_section = "table-inline-edit"
title = "Table Inline Edit"