from typing import NamedTuple from django.http import HttpRequest, HttpResponse from django_components import Component, get_component_url, register, types DESCRIPTION = "Handle the entire form submission flow in a single file and without Django's Form class." @register("thank_you_message") class ThankYouMessage(Component): class Kwargs(NamedTuple): name: str def get_template_data(self, args, kwargs: Kwargs, slots, context): return {"name": kwargs.name} template: types.django_html = """
Thank you for your submission, {{ name }}!