This repository has been archived on 2023-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
takahe/core/htmx.py

12 lines
279 B
Python
Raw Normal View History

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