From 9c424d9bb6aa0eb606128bcce3e33816967a2e8d Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Tue, 22 Nov 2022 19:21:01 -0700 Subject: Add manual HTMX refresh of timelines Refs #33 --- core/htmx.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/htmx.py (limited to 'core') diff --git a/core/htmx.py b/core/htmx.py new file mode 100644 index 0000000..c83fba9 --- /dev/null +++ b/core/htmx.py @@ -0,0 +1,11 @@ +from typing import Optional + + +class HTMXMixin: + template_name_htmx: Optional[str] = None + + def get_template_name(self): + if self.request.htmx and self.template_name_htmx: + return self.template_name_htmx + else: + return self.template_name -- cgit v1.2.3