takahe/core/htmx.py
2022-11-22 19:21:01 -07:00

11 lines
279 B
Python

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